Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Devel #2224

Merged
merged 182 commits into from
Dec 23, 2021
Merged

Devel #2224

merged 182 commits into from
Dec 23, 2021

Conversation

kmantel
Copy link
Collaborator

@kmantel kmantel commented Dec 7, 2021

No description provided.

dependabot bot and others added 30 commits September 18, 2021 02:06
Updates the requirements on [rich](https://github.com/willmcgugan/rich) to permit the latest version.
- [Release notes](https://github.com/willmcgugan/rich/releases)
- [Changelog](https://github.com/willmcgugan/rich/blob/master/CHANGELOG.md)
- [Commits](Textualize/rich@v10.1.0...v10.10.0)

---
updated-dependencies:
- dependency-name: rich
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
…l/rich-gte-10.1-and-lt-10.11

requirements: update rich requirement from <10.10,>=10.1 to >=10.1,<10.11
…he next move

Compare the move based on observations with the real bearing from player to prey.
Signed-off-by: Jan Vesely <[email protected]>
…the next move (#2121)

A slightly less trivial variant of the Predator-Prey model.
…function instead of RandomState

Results change since the 'seed' parameter is converted to list before use.
Signed-off-by: Jan Vesely <[email protected]>
Drop custom in-flight function check.
Remove any cost calculation and use generated random value as objective metric.

Signed-off-by: Jan Vesely <[email protected]>
…ialize parameters.random_state

Fix function copy workaround to reset the seed parameter,
the state will be adjusted by the seed setter function.
Use DEFAULT_SEED to avoid advancing global seed.

Signed-off-by: Jan Vesely <[email protected]>
Instead of resetting the PRNG state once per context,
the new approach compares the originally used seed with the new value
(either new setting or modulation).

This allows for better match in multi-trial executions with OCM:
Simulations will only reset PRNG if the modulated seed is different
from the one in the current execution context.
The result of evaluation will thus match the result of trial even
if OCM selects the same seed as originally used by the execution.

The PRNG state is also reset on direct seed modification to preserve
the old behaviour in situations like;
Func1.seed = n
Func2.seed = n
# Both Func1 and Func2 now follow the same random sequence irrespective
# of their original seed

Signed-off-by: Jan Vesely <[email protected]>
…ials

Construct the expected values in the test instead of using constants
to verify the semantics of reusing random seeds.

Signed-off-by: Jan Vesely <[email protected]>
Use == to compare strings
Drop unused imports.
Use is or is not when comparing to True or False.
2 blank lines after function/class definition.
Updates the requirements on [rich](https://github.com/willmcgugan/rich) to permit the latest version.
- [Release notes](https://github.com/willmcgugan/rich/releases)
- [Changelog](https://github.com/willmcgugan/rich/blob/master/CHANGELOG.md)
- [Commits](Textualize/rich@v10.1.0...v10.11.0)

---
updated-dependencies:
- dependency-name: rich
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
…l/rich-gte-10.1-and-lt-10.12

requirements: update rich requirement from <10.11,>=10.1 to >=10.1,<10.12
The original semantics was to reset random state once per context with the most up-to-date value of the seed.
The new approach is to reset random state every time the seed value changes, whether through direct assignment or modulation.

The practical change in semantics is subtle and helps match results between virtual executions and the simulated composition (see the comments in 'test_modulation_of_random_state' for details).
… if IntEnum

Bitwise combination of flags is still a flag.

Signed-off-by: Jan Vesely <[email protected]>
@github-actions
Copy link

This PR causes the following changes to the html docs (ubuntu-latest-3.7-x64):

diff -r docs-base/.buildinfo docs-head/.buildinfo
3c3
< config: e4eaff8bd460a1755b5775922fbff125
---
> config: 93a36d7daeeffc980fdbe13b5661e43b
diff -r docs-base/AutoAssociativeLearningMechanism.html docs-head/AutoAssociativeLearningMechanism.html
228c228
< <p>An AutoAssociativeLearningMechanism is a subclass of <a class="reference internal" href="LearningMechanism.html"><span class="doc">Learning Mechanism</span></a>, modified for use with a
---
> <p>An AutoAssociativeLearningMechanism is a subclass of <a class="reference internal" href="LearningMechanism.html"><span class="doc">LearningMechanism</span></a>, modified for use with a
239c239
< <p>An AutoAssociativeLearningMechanism is identical to a <a class="reference internal" href="LearningMechanism.html"><span class="doc">Learning Mechanism</span></a> in all respects except the following:</p>
---
> <p>An AutoAssociativeLearningMechanism is identical to a <a class="reference internal" href="LearningMechanism.html"><span class="doc">LearningMechanism</span></a> in all respects except the following:</p>
257c257
< to the weight change matrix;  as with a standard <a class="reference internal" href="LearningMechanism.html"><span class="doc">Learning Mechanism</span></a>, a scalar can also be specified to scale
---
> to the weight change matrix;  as with a standard <a class="reference internal" href="LearningMechanism.html"><span class="doc">LearningMechanism</span></a>, a scalar can also be specified to scale
265c265
< <p>An AutoAssociativeLearningMechanism executes in the same manner as standard <a class="reference internal" href="LearningMechanism.html"><span class="doc">Learning Mechanism</span></a>, with two exceptions:
---
> <p>An AutoAssociativeLearningMechanism executes in the same manner as standard <a class="reference internal" href="LearningMechanism.html"><span class="doc">LearningMechanism</span></a>, with two exceptions:
282c282
< <dd><p>Implements a <a class="reference internal" href="LearningMechanism.html"><span class="doc">Learning Mechanism</span></a> that modifies the <a class="reference internal" href="MappingProjection.html#psyneulink.core.components.projections.pathway.mappingprojection.MappingProjection.matrix" title="psyneulink.core.components.projections.pathway.mappingprojection.MappingProjection.matrix"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">matrix</span></code></a> parameter of an
---
> <dd><p>Implements a <a class="reference internal" href="LearningMechanism.html"><span class="doc">LearningMechanism</span></a> that modifies the <a class="reference internal" href="MappingProjection.html#psyneulink.core.components.projections.pathway.mappingprojection.MappingProjection.matrix" title="psyneulink.core.components.projections.pathway.mappingprojection.MappingProjection.matrix"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">matrix</span></code></a> parameter of an
418c418
< <a class="reference internal" href="LearningMechanism.html"><span class="doc">Learning Mechanism</span></a>, it can be assigned additional LearningSignals and/or LearningProjections to train
---
> <a class="reference internal" href="LearningMechanism.html"><span class="doc">LearningMechanism</span></a>, it can be assigned additional LearningSignals and/or LearningProjections to train
diff -r docs-base/AutodiffComposition.html docs-head/AutodiffComposition.html
389,391c389,392
< <li><p><strong>num_trials</strong> (<em>int</em><em> (</em><em>default=None</em><em>)</em>) – typically, the composition will infer the number of trials from the length of its input specification.
< To reuse the same inputs across many trials, you may specify an input dictionary with lists of length 1,
< or use default inputs, and select a number of trials with num_trials.</p></li>
---
> <li><p><strong>num_trials</strong> (<em>int</em><em> (</em><em>default=None</em><em>)</em>) – typically, the Composition infers the number of trials to execute from the length of its input
> specification.  However, <strong>num_trials</strong> can be used to enforce an exact number of trials to execute;
> if it is greater than there are inputs then inputs will be repeated (see <a class="reference internal" href="Composition.html#composition-execution-inputs"><span class="std std-ref">Input formats (including targets for learning)</span></a>
> for additional information).</p></li>
471,474c472,477
< <dd class="field-even"><p><strong>output value of the final Mechanism executed in the Composition</strong></p>
< </dd>
< <dt class="field-odd">Return type</dt>
< <dd class="field-odd"><p>various</p>
---
> <dd class="field-even"><p><ul class="simple">
> <li><p><strong>output_values</strong> (<em>List</em>)</p></li>
> <li><p><em>These are the values of the Composition’s output_CIM.output_ports, excluding those the source of which</em></p></li>
> <li><p><em>are from a (potentially nested) Node with NodeRole.PROBE in its enclosing Composition.</em></p></li>
> </ul>
> </p>
diff -r docs-base/BasicsAndPrimer.html docs-head/BasicsAndPrimer.html
971c971
< <p>PsyNeuLink has a native class – <a class="reference internal" href="LearningMechanism.html"><span class="doc">Learning Mechanism</span></a> – that can be used to implement various forms of learning,
---
> <p>PsyNeuLink has a native class – <a class="reference internal" href="LearningMechanism.html"><span class="doc">LearningMechanism</span></a> – that can be used to implement various forms of learning,
1119c1119
< <a class="reference internal" href="index.html#tutorial"><span class="std std-ref">Tutorial</span></a> provides a more thorough, interactive introduction to its use, and the <a class="reference internal" href="UserGuide.html"><span class="doc">User's Guide</span></a> provides
---
> <a class="reference internal" href="index_logo_with_text.html#tutorial"><span class="std std-ref">Tutorial</span></a> provides a more thorough, interactive introduction to its use, and the <a class="reference internal" href="UserGuide.html"><span class="doc">User's Guide</span></a> provides
diff -r docs-base/CombinationFunctions.html docs-head/CombinationFunctions.html
223c223
< <dd><p id="concatenate">Concatenates items in outer dimension (axis 0) of of <code class="xref any docutils literal notranslate"><span class="pre">variable</span></code> into a single array,
---
> <dd><p id="concatenate">Concatenates items in outer dimension (axis 0) of <code class="xref any docutils literal notranslate"><span class="pre">variable</span></code> into a single array,
225c225
< <p><code class="xref any docutils literal notranslate"><span class="pre">function</span></code> returns a 1d array with lenght equal to the sum of the lengths of the items
---
> <p><code class="xref any docutils literal notranslate"><span class="pre">function</span></code> returns a 1d array with length equal to the sum of the lengths of the items
diff -r docs-base/Component.html docs-head/Component.html
747c747
< <dd class="field-odd"><p><a class="reference internal" href="RegressionCFA.html#psyneulink.library.compositions.regressioncfa.RegressionCFA.Parameters" title="psyneulink.library.compositions.regressioncfa.RegressionCFA.Parameters">Parameters</a></p>
---
> <dd class="field-odd"><p><a class="reference internal" href="CompositionInterfaceMechanism.html#psyneulink.core.components.mechanisms.processing.compositioninterfacemechanism.CompositionInterfaceMechanism.Parameters" title="psyneulink.core.components.mechanisms.processing.compositioninterfacemechanism.CompositionInterfaceMechanism.Parameters">Parameters</a></p>
1188a1189,1208
> </dd></dl>
> 
> <dl class="py method">
> <dt class="sig sig-object py" id="psyneulink.core.components.component.Component.all_dependent_parameters">
> <span class="sig-name descname"><span class="pre">all_dependent_parameters</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">filter_name</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">filter_regex</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#psyneulink.core.components.component.Component.all_dependent_parameters" title="Permalink to this definition">¶</a></dt>
> <dd><p>Dictionary of Parameters of this Component and its         <a class="reference internal" href="#psyneulink.core.components.component.Component._dependent_components" title="psyneulink.core.components.component.Component._dependent_components"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">_dependent_components</span></code></a> filtered by <strong>filter_name</strong> and         <strong>filter_regex</strong>. If no filter is specified, all Parameters         are included.</p>
> <dl class="field-list simple">
> <dt class="field-odd">Parameters</dt>
> <dd class="field-odd"><ul class="simple">
> <li><p><strong>filter_name</strong> (<em>Union</em><em>[</em><em>str</em><em>, </em><em>Iterable</em><em>[</em><em>str</em><em>]</em><em>]</em><em>, </em><em>optional</em>) – The                 exact name or names of Parameters to include. Defaults                 to None.</p></li>
> <li><p><strong>filter_regex</strong> (<em>Union</em><em>[</em><em>str</em><em>, </em><em>Iterable</em><em>[</em><em>str</em><em>]</em><em>]</em><em>, </em><em>optional</em>) – Regular expression patterns. If any pattern matches a                 Parameter name (using re.match), it will be included                 in the result. Defaults to None.</p></li>
> </ul>
> </dd>
> <dt class="field-even">Returns</dt>
> <dd class="field-even"><p>Component]: Dictionary of filtered Parameters</p>
> </dd>
> <dt class="field-odd">Return type</dt>
> <dd class="field-odd"><p>dict[<a class="reference internal" href="Parameters.html#psyneulink.core.globals.parameters.Parameter" title="psyneulink.core.globals.parameters.Parameter">Parameter</a></p>
> </dd>
> </dl>
diff -r docs-base/Composition.html docs-head/Composition.html
207a208
> <li class="toctree-l1"><a class="reference internal" href="ParameterEstimationComposition.html">ParameterEstimationComposition</a></li>
253c254,261
< <li><p><a class="reference internal" href="#composition-nested"><span class="std std-ref">Nested Compositions</span></a></p></li>
---
> <li><dl class="simple">
> <dt><a class="reference internal" href="#composition-nested"><span class="std std-ref">Nested Compositions</span></a></dt><dd><ul>
> <li><p><a class="reference internal" href="#composition-probes"><span class="std std-ref">Probes</span></a></p></li>
> </ul>
> </dd>
> </dl>
> </li>
> <li><p><a class="reference internal" href="#composition-cims"><span class="std std-ref">CompositionInterfaceMechanisms</span></a></p></li>
457c465,466
< inserting a default Projection between any adjacent pair of Nodes for which one is not otherwise specified;
---
> inserting a default Projection between any adjacent pair of Nodes for which one is not otherwise specified
> (or possibly a set of Projections if either Node is a Composition – see method documentation for details);
521c530
< Composition’s structure is stored in its <a class="reference internal" href="#psyneulink.core.compositions.composition.Composition.graph" title="psyneulink.core.compositions.composition.Composition.graph"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">graph</span></code></a> attribute, that is a <code class="xref any docutils literal notranslate"><span class="pre">Graph</span></code> object describing
---
> Composition’s structure is stored in its <a class="reference internal" href="#psyneulink.core.compositions.composition.Composition.graph" title="psyneulink.core.compositions.composition.Composition.graph"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">graph</span></code></a> attribute, that is a <a class="reference internal" href="#psyneulink.core.compositions.composition.Graph" title="psyneulink.core.compositions.composition.Graph"><code class="xref any py py-class docutils literal notranslate"><span class="pre">Graph</span></code></a> object describing
525c534
< displayed using the Compositon’s <a class="reference internal" href="Visualization.html#psyneulink.core.compositions.showgraph.ShowGraph.show_graph" title="psyneulink.core.compositions.showgraph.ShowGraph.show_graph"><code class="xref any py py-meth docutils literal notranslate"><span class="pre">show_graph</span></code></a> method (see <a class="reference internal" href="Visualization.html#showgraph-show-graph-method"><span class="std std-ref">Use of the show_graph Method</span></a>).</p>
---
> displayed using the Composition’s <a class="reference internal" href="Visualization.html#psyneulink.core.compositions.showgraph.ShowGraph.show_graph" title="psyneulink.core.compositions.showgraph.ShowGraph.show_graph"><code class="xref any py py-meth docutils literal notranslate"><span class="pre">show_graph</span></code></a> method (see <a class="reference internal" href="Visualization.html#showgraph-show-graph-method"><span class="std std-ref">Use of the show_graph Method</span></a>).</p>
529c538
< Projections among the Nodes of the Compostion never form a loop, then it is a <a class="reference external" href="https://en.wikipedia.org/wiki/Acyclic_graph">directed acyclic graph (DAG)</a>, and the order in which its Nodes are executed can be determined by
---
> Projections among the Nodes of the Composition never form a loop, then it is a <a class="reference external" href="https://en.wikipedia.org/wiki/Acyclic_graph">directed acyclic graph (DAG)</a>, and the order in which its Nodes are executed can be determined by
540,541c549,550
< one or more <a class="reference internal" href="#psyneulink.core.compositions.composition.NodeRole" title="psyneulink.core.compositions.composition.NodeRole"><code class="xref any py py-class docutils literal notranslate"><span class="pre">NodeRoles</span></code></a> automatically when a Composition is constructed, and when Nodes or <a class="reference internal" href="#composition-pathways"><span class="std std-ref">Pathways</span></a> are added to it. However, some of these can be explicitly assigned by specifying the desired
< <a class="reference internal" href="#psyneulink.core.compositions.composition.NodeRole" title="psyneulink.core.compositions.composition.NodeRole"><code class="xref any py py-class docutils literal notranslate"><span class="pre">NodeRole</span></code></a> in any of the following places:</p>
---
> one or more <a class="reference internal" href="#psyneulink.core.compositions.composition.NodeRole" title="psyneulink.core.compositions.composition.NodeRole"><code class="xref any py py-class docutils literal notranslate"><span class="pre">NodeRoles</span></code></a> automatically when a Composition is constructed, and when Nodes or <a class="reference internal" href="#composition-pathways"><span class="std std-ref">Pathways</span></a> are added to it or new <a class="reference internal" href="Projection.html"><span class="doc">Projections</span></a> are assigned to it. However, some of these
> can be explicitly assigned by specifying the desired <a class="reference internal" href="#psyneulink.core.compositions.composition.NodeRole" title="psyneulink.core.compositions.composition.NodeRole"><code class="xref any py py-class docutils literal notranslate"><span class="pre">NodeRole</span></code></a> in any of the following places:</p>
545c554
< <li><p>a tuple specifying the Node in the <strong>pathways</strong> argument of the Compositon’s constructor, a <a class="reference internal" href="Pathway.html"><span class="doc">Pathway</span></a>'s
---
> <li><p>a tuple specifying the Node in the <strong>pathways</strong> argument of the Composition’s constructor, a <a class="reference internal" href="Pathway.html"><span class="doc">Pathway</span></a>'s
548,549c557
< <li><p>the <strong>roles</strong> argument of the <a class="reference internal" href="#psyneulink.core.compositions.composition.Composition.require_node_roles" title="psyneulink.core.compositions.c
...

See CI logs for the full diff.

@lgtm-com
Copy link
Contributor

lgtm-com bot commented Dec 19, 2021

This pull request introduces 14 alerts and fixes 48 when merging 4bcf8e8 into 912f691 - view on LGTM.com

new alerts:

  • 4 for Except block handles 'BaseException'
  • 3 for Unused local variable
  • 2 for Modification of dictionary returned by locals()
  • 1 for Wrong name for an argument in a call
  • 1 for Comparison using is when operands support `__eq__`
  • 1 for Unreachable code
  • 1 for Module is imported with 'import' and 'import from'
  • 1 for `__init__` method calls overridden method

fixed alerts:

  • 33 for Unused import
  • 12 for Comparison using is when operands support `__eq__`
  • 1 for Wrong name for an argument in a call
  • 1 for Except block handles 'BaseException'
  • 1 for `__init__` method calls overridden method

@kmantel kmantel temporarily deployed to github-pages December 21, 2021 05:55 Inactive
@github-actions
Copy link

This PR causes the following changes to the html docs (ubuntu-latest-3.7-x64):

diff -r docs-base/.buildinfo docs-head/.buildinfo
3c3
< config: e4eaff8bd460a1755b5775922fbff125
---
> config: 93a36d7daeeffc980fdbe13b5661e43b
diff -r docs-base/AutoAssociativeLearningMechanism.html docs-head/AutoAssociativeLearningMechanism.html
228c228
< <p>An AutoAssociativeLearningMechanism is a subclass of <a class="reference internal" href="LearningMechanism.html"><span class="doc">Learning Mechanism</span></a>, modified for use with a
---
> <p>An AutoAssociativeLearningMechanism is a subclass of <a class="reference internal" href="LearningMechanism.html"><span class="doc">LearningMechanism</span></a>, modified for use with a
239c239
< <p>An AutoAssociativeLearningMechanism is identical to a <a class="reference internal" href="LearningMechanism.html"><span class="doc">Learning Mechanism</span></a> in all respects except the following:</p>
---
> <p>An AutoAssociativeLearningMechanism is identical to a <a class="reference internal" href="LearningMechanism.html"><span class="doc">LearningMechanism</span></a> in all respects except the following:</p>
257c257
< to the weight change matrix;  as with a standard <a class="reference internal" href="LearningMechanism.html"><span class="doc">Learning Mechanism</span></a>, a scalar can also be specified to scale
---
> to the weight change matrix;  as with a standard <a class="reference internal" href="LearningMechanism.html"><span class="doc">LearningMechanism</span></a>, a scalar can also be specified to scale
265c265
< <p>An AutoAssociativeLearningMechanism executes in the same manner as standard <a class="reference internal" href="LearningMechanism.html"><span class="doc">Learning Mechanism</span></a>, with two exceptions:
---
> <p>An AutoAssociativeLearningMechanism executes in the same manner as standard <a class="reference internal" href="LearningMechanism.html"><span class="doc">LearningMechanism</span></a>, with two exceptions:
282c282
< <dd><p>Implements a <a class="reference internal" href="LearningMechanism.html"><span class="doc">Learning Mechanism</span></a> that modifies the <a class="reference internal" href="MappingProjection.html#psyneulink.core.components.projections.pathway.mappingprojection.MappingProjection.matrix" title="psyneulink.core.components.projections.pathway.mappingprojection.MappingProjection.matrix"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">matrix</span></code></a> parameter of an
---
> <dd><p>Implements a <a class="reference internal" href="LearningMechanism.html"><span class="doc">LearningMechanism</span></a> that modifies the <a class="reference internal" href="MappingProjection.html#psyneulink.core.components.projections.pathway.mappingprojection.MappingProjection.matrix" title="psyneulink.core.components.projections.pathway.mappingprojection.MappingProjection.matrix"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">matrix</span></code></a> parameter of an
418c418
< <a class="reference internal" href="LearningMechanism.html"><span class="doc">Learning Mechanism</span></a>, it can be assigned additional LearningSignals and/or LearningProjections to train
---
> <a class="reference internal" href="LearningMechanism.html"><span class="doc">LearningMechanism</span></a>, it can be assigned additional LearningSignals and/or LearningProjections to train
diff -r docs-base/AutodiffComposition.html docs-head/AutodiffComposition.html
389,391c389,392
< <li><p><strong>num_trials</strong> (<em>int</em><em> (</em><em>default=None</em><em>)</em>) – typically, the composition will infer the number of trials from the length of its input specification.
< To reuse the same inputs across many trials, you may specify an input dictionary with lists of length 1,
< or use default inputs, and select a number of trials with num_trials.</p></li>
---
> <li><p><strong>num_trials</strong> (<em>int</em><em> (</em><em>default=None</em><em>)</em>) – typically, the Composition infers the number of trials to execute from the length of its input
> specification.  However, <strong>num_trials</strong> can be used to enforce an exact number of trials to execute;
> if it is greater than there are inputs then inputs will be repeated (see <a class="reference internal" href="Composition.html#composition-execution-inputs"><span class="std std-ref">Input formats (including targets for learning)</span></a>
> for additional information).</p></li>
471,474c472,477
< <dd class="field-even"><p><strong>output value of the final Mechanism executed in the Composition</strong></p>
< </dd>
< <dt class="field-odd">Return type</dt>
< <dd class="field-odd"><p>various</p>
---
> <dd class="field-even"><p><ul class="simple">
> <li><p><strong>output_values</strong> (<em>List</em>)</p></li>
> <li><p><em>These are the values of the Composition’s output_CIM.output_ports, excluding those the source of which</em></p></li>
> <li><p><em>are from a (potentially nested) Node with NodeRole.PROBE in its enclosing Composition.</em></p></li>
> </ul>
> </p>
diff -r docs-base/BasicsAndPrimer.html docs-head/BasicsAndPrimer.html
971c971
< <p>PsyNeuLink has a native class – <a class="reference internal" href="LearningMechanism.html"><span class="doc">Learning Mechanism</span></a> – that can be used to implement various forms of learning,
---
> <p>PsyNeuLink has a native class – <a class="reference internal" href="LearningMechanism.html"><span class="doc">LearningMechanism</span></a> – that can be used to implement various forms of learning,
1119c1119
< <a class="reference internal" href="index.html#tutorial"><span class="std std-ref">Tutorial</span></a> provides a more thorough, interactive introduction to its use, and the <a class="reference internal" href="UserGuide.html"><span class="doc">User's Guide</span></a> provides
---
> <a class="reference internal" href="index_logo_with_text.html#tutorial"><span class="std std-ref">Tutorial</span></a> provides a more thorough, interactive introduction to its use, and the <a class="reference internal" href="UserGuide.html"><span class="doc">User's Guide</span></a> provides
diff -r docs-base/CombinationFunctions.html docs-head/CombinationFunctions.html
223c223
< <dd><p id="concatenate">Concatenates items in outer dimension (axis 0) of of <code class="xref any docutils literal notranslate"><span class="pre">variable</span></code> into a single array,
---
> <dd><p id="concatenate">Concatenates items in outer dimension (axis 0) of <code class="xref any docutils literal notranslate"><span class="pre">variable</span></code> into a single array,
225c225
< <p><code class="xref any docutils literal notranslate"><span class="pre">function</span></code> returns a 1d array with lenght equal to the sum of the lengths of the items
---
> <p><code class="xref any docutils literal notranslate"><span class="pre">function</span></code> returns a 1d array with length equal to the sum of the lengths of the items
diff -r docs-base/Component.html docs-head/Component.html
747c747
< <dd class="field-odd"><p><a class="reference internal" href="RegressionCFA.html#psyneulink.library.compositions.regressioncfa.RegressionCFA.Parameters" title="psyneulink.library.compositions.regressioncfa.RegressionCFA.Parameters">Parameters</a></p>
---
> <dd class="field-odd"><p><a class="reference internal" href="CompositionInterfaceMechanism.html#psyneulink.core.components.mechanisms.processing.compositioninterfacemechanism.CompositionInterfaceMechanism.Parameters" title="psyneulink.core.components.mechanisms.processing.compositioninterfacemechanism.CompositionInterfaceMechanism.Parameters">Parameters</a></p>
1188a1189,1208
> </dd></dl>
> 
> <dl class="py method">
> <dt class="sig sig-object py" id="psyneulink.core.components.component.Component.all_dependent_parameters">
> <span class="sig-name descname"><span class="pre">all_dependent_parameters</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">filter_name</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">filter_regex</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#psyneulink.core.components.component.Component.all_dependent_parameters" title="Permalink to this definition">¶</a></dt>
> <dd><p>Dictionary of Parameters of this Component and its         <a class="reference internal" href="#psyneulink.core.components.component.Component._dependent_components" title="psyneulink.core.components.component.Component._dependent_components"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">_dependent_components</span></code></a> filtered by <strong>filter_name</strong> and         <strong>filter_regex</strong>. If no filter is specified, all Parameters         are included.</p>
> <dl class="field-list simple">
> <dt class="field-odd">Parameters</dt>
> <dd class="field-odd"><ul class="simple">
> <li><p><strong>filter_name</strong> (<em>Union</em><em>[</em><em>str</em><em>, </em><em>Iterable</em><em>[</em><em>str</em><em>]</em><em>]</em><em>, </em><em>optional</em>) – The                 exact name or names of Parameters to include. Defaults                 to None.</p></li>
> <li><p><strong>filter_regex</strong> (<em>Union</em><em>[</em><em>str</em><em>, </em><em>Iterable</em><em>[</em><em>str</em><em>]</em><em>]</em><em>, </em><em>optional</em>) – Regular expression patterns. If any pattern matches a                 Parameter name (using re.match), it will be included                 in the result. Defaults to None.</p></li>
> </ul>
> </dd>
> <dt class="field-even">Returns</dt>
> <dd class="field-even"><p>Component]: Dictionary of filtered Parameters</p>
> </dd>
> <dt class="field-odd">Return type</dt>
> <dd class="field-odd"><p>dict[<a class="reference internal" href="Parameters.html#psyneulink.core.globals.parameters.Parameter" title="psyneulink.core.globals.parameters.Parameter">Parameter</a></p>
> </dd>
> </dl>
diff -r docs-base/Composition.html docs-head/Composition.html
207a208
> <li class="toctree-l1"><a class="reference internal" href="ParameterEstimationComposition.html">ParameterEstimationComposition</a></li>
253c254,261
< <li><p><a class="reference internal" href="#composition-nested"><span class="std std-ref">Nested Compositions</span></a></p></li>
---
> <li><dl class="simple">
> <dt><a class="reference internal" href="#composition-nested"><span class="std std-ref">Nested Compositions</span></a></dt><dd><ul>
> <li><p><a class="reference internal" href="#composition-probes"><span class="std std-ref">Probes</span></a></p></li>
> </ul>
> </dd>
> </dl>
> </li>
> <li><p><a class="reference internal" href="#composition-cims"><span class="std std-ref">CompositionInterfaceMechanisms</span></a></p></li>
457c465,466
< inserting a default Projection between any adjacent pair of Nodes for which one is not otherwise specified;
---
> inserting a default Projection between any adjacent pair of Nodes for which one is not otherwise specified
> (or possibly a set of Projections if either Node is a Composition – see method documentation for details);
521c530
< Composition’s structure is stored in its <a class="reference internal" href="#psyneulink.core.compositions.composition.Composition.graph" title="psyneulink.core.compositions.composition.Composition.graph"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">graph</span></code></a> attribute, that is a <code class="xref any docutils literal notranslate"><span class="pre">Graph</span></code> object describing
---
> Composition’s structure is stored in its <a class="reference internal" href="#psyneulink.core.compositions.composition.Composition.graph" title="psyneulink.core.compositions.composition.Composition.graph"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">graph</span></code></a> attribute, that is a <a class="reference internal" href="#psyneulink.core.compositions.composition.Graph" title="psyneulink.core.compositions.composition.Graph"><code class="xref any py py-class docutils literal notranslate"><span class="pre">Graph</span></code></a> object describing
525c534
< displayed using the Compositon’s <a class="reference internal" href="Visualization.html#psyneulink.core.compositions.showgraph.ShowGraph.show_graph" title="psyneulink.core.compositions.showgraph.ShowGraph.show_graph"><code class="xref any py py-meth docutils literal notranslate"><span class="pre">show_graph</span></code></a> method (see <a class="reference internal" href="Visualization.html#showgraph-show-graph-method"><span class="std std-ref">Use of the show_graph Method</span></a>).</p>
---
> displayed using the Composition’s <a class="reference internal" href="Visualization.html#psyneulink.core.compositions.showgraph.ShowGraph.show_graph" title="psyneulink.core.compositions.showgraph.ShowGraph.show_graph"><code class="xref any py py-meth docutils literal notranslate"><span class="pre">show_graph</span></code></a> method (see <a class="reference internal" href="Visualization.html#showgraph-show-graph-method"><span class="std std-ref">Use of the show_graph Method</span></a>).</p>
529c538
< Projections among the Nodes of the Compostion never form a loop, then it is a <a class="reference external" href="https://en.wikipedia.org/wiki/Acyclic_graph">directed acyclic graph (DAG)</a>, and the order in which its Nodes are executed can be determined by
---
> Projections among the Nodes of the Composition never form a loop, then it is a <a class="reference external" href="https://en.wikipedia.org/wiki/Acyclic_graph">directed acyclic graph (DAG)</a>, and the order in which its Nodes are executed can be determined by
540,541c549,550
< one or more <a class="reference internal" href="#psyneulink.core.compositions.composition.NodeRole" title="psyneulink.core.compositions.composition.NodeRole"><code class="xref any py py-class docutils literal notranslate"><span class="pre">NodeRoles</span></code></a> automatically when a Composition is constructed, and when Nodes or <a class="reference internal" href="#composition-pathways"><span class="std std-ref">Pathways</span></a> are added to it. However, some of these can be explicitly assigned by specifying the desired
< <a class="reference internal" href="#psyneulink.core.compositions.composition.NodeRole" title="psyneulink.core.compositions.composition.NodeRole"><code class="xref any py py-class docutils literal notranslate"><span class="pre">NodeRole</span></code></a> in any of the following places:</p>
---
> one or more <a class="reference internal" href="#psyneulink.core.compositions.composition.NodeRole" title="psyneulink.core.compositions.composition.NodeRole"><code class="xref any py py-class docutils literal notranslate"><span class="pre">NodeRoles</span></code></a> automatically when a Composition is constructed, and when Nodes or <a class="reference internal" href="#composition-pathways"><span class="std std-ref">Pathways</span></a> are added to it or new <a class="reference internal" href="Projection.html"><span class="doc">Projections</span></a> are assigned to it. However, some of these
> can be explicitly assigned by specifying the desired <a class="reference internal" href="#psyneulink.core.compositions.composition.NodeRole" title="psyneulink.core.compositions.composition.NodeRole"><code class="xref any py py-class docutils literal notranslate"><span class="pre">NodeRole</span></code></a> in any of the following places:</p>
545c554
< <li><p>a tuple specifying the Node in the <strong>pathways</strong> argument of the Compositon’s constructor, a <a class="reference internal" href="Pathway.html"><span class="doc">Pathway</span></a>'s
---
> <li><p>a tuple specifying the Node in the <strong>pathways</strong> argument of the Composition’s constructor, a <a class="reference internal" href="Pathway.html"><span class="doc">Pathway</span></a>'s
548,549c557
< <li><p>the <strong>roles</strong> argument of the <a class="reference internal" href="#psyneulink.core.compositions.composition.Composition.require_node_roles" title="psyneulink.core.compositions.c
...

See CI logs for the full diff.

@lgtm-com
Copy link
Contributor

lgtm-com bot commented Dec 21, 2021

This pull request introduces 14 alerts and fixes 48 when merging a2afe77 into 912f691 - view on LGTM.com

new alerts:

  • 4 for Except block handles 'BaseException'
  • 3 for Unused local variable
  • 2 for Modification of dictionary returned by locals()
  • 1 for Wrong name for an argument in a call
  • 1 for Comparison using is when operands support `__eq__`
  • 1 for Unreachable code
  • 1 for Module is imported with 'import' and 'import from'
  • 1 for `__init__` method calls overridden method

fixed alerts:

  • 33 for Unused import
  • 12 for Comparison using is when operands support `__eq__`
  • 1 for Wrong name for an argument in a call
  • 1 for Except block handles 'BaseException'
  • 1 for `__init__` method calls overridden method

* • test_report.py:  passing all tests

* • Passes all tests!

* -

* -

* • composition.py: reorganize with #region and #enregions

* • composition.py: reorganize with #region and #enregions

* • controlmechanism.py, optimizationcontrolmechanism.py:
  - _instantiate_monitor_for_control_input_ports -> _parse_monitor_control_input_ports
  - refactored to support allow_probes option on ocm

* -

* -

* -

* • controlmechanism.py, optimizationcontrolmechanism.py:
  - _instantiate_monitor_for_control_input_ports -> _parse_monitor_control_input_ports
  - refactored to support allow_probes option on ocm

* • controlmechanism.py, optimizationcontrolmechanism.py:
  - _instantiate_monitor_for_control_input_ports -> _parse_monitor_control_input_ports
  - refactored to support allow_probes option on ocm

* -

* • composition.py:
  __init__: move controller to after add_nodes and add_linear_pathway

* -

* - test_control: only test_hanging_control_spec_outer_controller not passing

* -

* -

* -

* -

* -

* -

* • composition.py:
  _instantiate_control_projections:
     weird requirement for double-call to controller._instantiate_control_signal

* • test_paremtercomposition.py:
  restored parameter spec that causes crash ('threshold',Decision2)

* ª Attempt to fix problem with partially overlapping local and ocm control specs

- composition.py
  - _get_control_signals_for_composition:  (see 11/20/21)
      - added (but commented out change) to "if node.controller" to "if not node.controller"
      - changed append to extend
  - _instantiation_control_projection:
      - got rid of try and except double-call to controller._instantiate_control_signals
      -  outdented call to self.controller._activate_projections_for_composition at end

- controlmechanism.py:
    - _check_for_duplicates:  add warning and return duplicates

- optimizationcontrolmechanism._instantiate_control_signals:
    - add call to self.agent_rep._get_control_signals_for_composition() to get local control specs (on mechs in comp)
    - eliminate duplicates with control_signal specs on OCM
    - instantiate local + ocm control_signals

- parameterestimationcomposition.py
  - added context to various calls

* see later commit

* see later commit

* see later commit

* see later commit

* - This branch passes all tests except:
   - test_parameterestimationcomposition
   - test_composition/test_partially_overlapping_control_specs (ADDED IN THIS COMMINT)

- All relevant changes to this branch are marked as "11/21/21."
  However, most are commented out as they break other things.

- The tests above both involve local control specifications (on mechanism within a nested comp)
  and on the OCM for the outer composition, some of which are for the same nested mechs

- Both tests fail with:
   "AttributeError: 'NoneType' object has no attribute '_get_by_time_scale'" (in component.py LINE 3276)
   This may be due to a problem with context setting, since the error is because the modulation Parameter
   of the ControlProjection is returning "None" rather than "multiplicative_param" (when called with get(context)),
   whereas "multiplicative_param" is returned with a call to get() (i.e., with no context specified)

- Most of test_partially_overlapping_control_specs is passed if
   changes marked "11/21/21 NEW" in optimizationcontrolmechanism.py (LINE 1390) are implemented,
   but it does not properly route ControlProjections through parameter_CIMS (see last assert in test).
   Furthermore, test_parameterestimationcompsition fails with the mod param error, even though the
   model has similar structure (i.e., outer composition -- in this case a ParameterEstimationComposition)
   with an OCM that is given control specs that overlap with ones in a nested composition.

- There are also several other things in composition I found puzzling and tried modifying, but that cuased failures:
  - _get_control_signals_for_composition():
      - seems "if node.controller" should be "if **not** node.controller" (emphasis added just for comment)
      - "append" should be "extend"
  - _instantiate_control_projection():
      -  call to self.controller._activate_projections_for_composition (at end of method) should not be indented

* - small mods; don't impact anything relevant to prior commit message

* - small mods; don't impact anything relevant to prior commit message

* - small mods; don't impact anything relevant to prior commit message

* - finished adding formatting regions to composition.py

* -

* • composition.py:
  - rename _check_projection_initialization_status -> _check_controller_initialization_status
  - add _check_nodes_initialization_status(context=context)
    (and calls it with _check_controller_initialization_status)

* • show_graph.py:  addressed bug associated with ocm.allow_direct_probe

* • show_graph.py:  addressed bug associated with ocm.allow_direct_probe

* -

* Composition: add_controller: set METHOD as context source early

* -

* • composition.py
  retore append of control_signals in _instantiate_control_projections()

* • composition.py
  restore append of control_signals in _instantiate_control_projections()

• test_composition.py:
  add test_partially_overlapping_local_and_control_mech_control_specs_in_unnested_and_nested_comp

* • test_partially_overlapping_local_and_control_mech_control_specs_in_unnested_and_nested_comp():
  - added clear_registry() to allow names to be reused in both runs of test

* • composition.py
  docstring:  added projections entry to list of attributes
  - add_controller:  added call to _add_node_aux_components() for controller

* • composition.py
  _add_node_aux_components(): added deletion of item from aux_components if instantiated

* • composition.py
  - comment out _add_node_aux_components() (causing new failures)
  - move _instantiate_control_projections to be with _instantiate_control_projections,
       after self.add_node(self.controller.objective_mechanism (to be more orderly)

* -

* - confirm that it passes all tests exception test_composition/test_partially_overlapping...
  (with addition of _add_aux_components in add_controller commented out)

* • composition.py:  some more fixed to add_controller that now fail only one test:
    - test_agent_rep_assignement_as_controller_and_replacement

* • Passes *all* current tests

* • composition.py:
  - add_controller:  few more minor mods;
  still passes all tests

* -

* -

* -

* • controlmechanism.py:
  - __init__: resrict specification to only one of control, modulatory_signals, or control_signals (synonyms)

* -

* • composition.py:  in progress fix of bug in instantiating shadow projections for ocm.state_input_ports

* • composition.py:
  - _get_original_senders():  added support for nested composition
    needs to be checked for more than one level
    needs to be refactored to be recursive

* • optimizationcontrolmechanism.py
  - _update_state_input_ports_for_controller:  fix invalid_state_features to allow input_CIM of nested comp in agent_rep

* -

* • composition.py
 - _get_original_senders: made recursive

* • test_show_graph.py: update for fixes

* -

* • tests:  passes all in test_show_graph.py and test_report.py

* Passes all tests

* - comment clean-up

* • composition.py
 - add_controller and _get_nested_node_CIM_port:
   added support for forced assignment of NodeRole.OUTPUT for nodes specified in OCM.monitor_for_control,
   but referenced 'allow_probes' attribute still needs to be implemented

* • composition.py, optimizationcontrolmechanism.py:
  allow_probes fully implemented

* • show_graph.py:  fixed bug causing extra projections to OCM

* • composition.py:
  - _update_shadow_projections(): fix handling of deep nesting

* • optimizationcontrolmechanism.py: add agent_rep_type property

* • optimizationcontrolmechanism.py:
  - state_feature_function -> state_feature_functions

* • optimizationcontrolmechanism.py:
  - _validate_params:  validate state_feature_functions
  - _update_state_input_ports_for_controller: implement assignment of state_feature_functions

* -

* -

* • Passes all tests except test_json with 'model_with_control'

* -

* • composition.py
  - add_projection:  delete instantiation of shadow projections (handled by _update_shadow_projections)

* • composition.py
  - add_projection:  delete instantiation of shadow projections (handled by _update_shadow_projections)
  - remove calls to _update_shadows_dict

* • composition.py
  - add_projection:  delete instantiation of shadow projections (handled by _update_shadow_projections)
  - remove calls to _update_shadows_dict

* -

* • test_two_origins_two_input_ports:  crashes on failure of C->B to update

* -

* • composition.py
  - added property shadowing_dict that has shadowing ports as keys and the ports they shadow as values
  - refactored _update_shadowing_projections to use shadowing_dict

* • optimizationcontrolmechanism.py
  - _update_state_input_ports:  modified validations for nested nodes;  still failing some tests

* • optimizationcontrolmechanism.py
  - _update_state_input_ports:
     more careful and informative validation that state_input_ports are in comp or nested comp and are INPUT nodes thereof;
     passes all tests except test_two_origins_two_input_ports as before

* • composition.py
  _get_invalid_aux_components():  defer all shadow projections until _update_shadow_projections

* • composition.py
  _get_invalid_aux_components():  bug fix in test for shadow projections

* Port: _remove_projection_to_port: don't reduce variable below length 1

even ports with no incoming projections have variable at least length 1

* • composition.py
  add_node(): marked (but haven't removed) code block instantiating shadow_projections
   that seems now to be redundant with _update_shadow_projection

* • show_graph.py
  - _assign_cim_components: supress showing projections not in composition

* • composition.py:
  _analyze_graph():  add extra call to _determine_node_roles after _update_shadow_projections
  _run():  moved block of code at beginning initializing scheduler to after
           _complete_init_of_partially_initialized_nodes and _analyze_graph()

• show_graph.py
  - add test to all loops on projections:  "if proj in composition.projection"

* • show_graph.py
  - add show_projections_not_in_composition option for debugging

* • composition.py
  _update_shadow_projections(): delete unused shadow projections and corresponding ports

* • composition.py
  _update_shadow_projections(): fix bug in deletion of unused shadow projections and ports

• test_show_graph:  tests failing, need mods to accomodate changes

* • composition.py:
  _analyze_graph():  add extra call to _determine_node_roles after _update_shadow_projections
  _run():  moved block of code at beginning initializing scheduler to after
           _complete_init_of_partially_initialized_nodes and _analyze_graph()

• show_graph.py
  - add test to all loops on projections:  "if proj in composition.projection"

* • show_graph.py
  fixes; now passes all show_graph tests

* -

* • composition.py
  _update_shadow_projections:  raise error for attempt to shadow INTERNAL Node of nested comp

* -

* -

* • test_composition.py
  implemented test_shadow_nested_nodes that tests shadowing of nested nodes

* -

* -

* -

* -

* • optimizationcontrolmechanism.py: docstring mods

* • composition.py:
  - add allow_probes and exclude_probes_from_output

* • composition.py:
  - docstring mods re: allow_probes

• optimizationcontrolmechanism.py:
  - allow_probes:  eliminate DIRECT setting
  - remove _parse_monitor_for_control_input_ports (no longer needed without allow_probes=DIRECT)

* • composition.py:
  - change "exclude_probes_from_output" -> "include_probes_in_output"

* • composition.py:
  - docstring mods re: allow_probes and include_probes_in_output

* • composition.py:
  - docstring mods re: allow_probes and include_probes_in_output

* • controlmechanism.py:
  - add allow_probes handling (moved from OCM)

• optimizationcontrolmechanism.py:
  - move allow_probes to controlmechanism.py

• composition.py:
  - refactor handling of allow_probes to permit for any ControlMechanism

• objectivemechanism.py:
  - add modulatory_mechanism attribute

* • controlmechanism.py:
  - add allow_probes handling (moved from OCM)

• optimizationcontrolmechanism.py:
  - move allow_probes to controlmechanism.py

• composition.py:
  - refactor handling of allow_probes to permit for any ControlMechanism
  - add _handle_allow_probes_for_control() to reconcile setting on Composition and ControlMechanism

• objectivemechanism.py:
  - add modulatory_mechanism attribute

* • composition.py
  add assignment of learning_mechanism to objective_mechanism.modulatory_mechanism for add_learning methods

* • docstring mods

* -

* -

* • optimizationcontrolmechanism.py: docstring revs

* -

* -

* • test_composition.py:
  - add test_unnested_PROBE
  - add test_nested_PROBES
    TBD: test include_probes_in_output

* -

* • composition.py
  - add_node():  support tuple with required_role

* -

* • composition.py:
  - _determine_node_roles:
     fix bug in which nested comp was prevented from being an OUTPUT Node if,
     in addition to Nodes that qualifed as OUTPUT, it also had nodes that projected
     to Nodes in an outer comp (making it look like it was INTERNAL)

* -

* • composition.py:
  - add_node(): enforce include_probes_in_output = True for nested Compositions
  - execute():
    - replace return of output_value with get_output_value()

* -

* • CompositionInterfaceMechanism.rst:
  - correct path ref

• compositioninterfacemechanism.py:
  - docstring fixes

* • compositioninterfacemechanism.py:
  - docstring edits

* -

* -

* -

* -

* -

* -

* -

* -

* -

* • composition.py:
  add_projection:  _parse_projection_spec -> _instantiate_projection_from_spec

* • composition.py:
  add_projection:  _parse_projection_spec -> _instantiate_projection_from_spec

* • composition.py
  - add_linear_processing_pathway:
    support one->many and many->one configurations in pathway specification
    (see docstring for method)

* -

* • composition.py
  _add_linear_processing_pathway, add_projection, _is_pathway_entry_spec:
  - support many->one and one->many projections between mech and comps in pathway spec:  working
  - support set of Projections as legal entry in pathway spec:  TBI

* • composition.py
  _add_linear_processing_pathway, add_projection, _is_pathway_entry_spec:
  - support many->one and one->many projections between mech and comps in pathway spec:  working
  - support set of Projections as legal entry in pathway spec:  TBI

* • show_graph.py
  _assign_cim_components(): fix bug in which comp1_output_cim->comp2_input_cim was skipped

* • compositioninterfacemechanism.py: docstring mod

* -

* • composition.py: minor formatting

* • composition.py
  add_linear_processing_pathway(): eliminate TARGET Nodes from one->many

* -

* • composition.py:
  - add_linear_processing_pathway(): add recursive search for nested INPUT and OUTPUT nodes

* • composition.py:
  - add_linear_processing_pathway():
    - exclude Target Nodes from search for INPUT nodes (handled by learning)
    - add recursive search for nested INPUT and OUTPUT nodes

* -

* -

* • composition.py
  add_projection:  working on adding support for projection sets

* -

* -

* • composition.py
  - add _get_nested_nodes_with_same_roles_at_all_levels
  - add_linear_processing_pathway:
    call _get_nested_nodes_with_same_roles_at_all_levels

* • composition.py
  - add_linear_processing_pathway:  add support for inline specification of set of Projections

* -

* -

* • composition.py
  add_linear_processing_pathway: refactored to support inline specification of sets of Projections

* • composition.py
  add_linear_processing_pathway: docstring edits for Projection set specification

* -

* -

* -

* -

* -

* • test_composition.py:
  - add test_add_multiple_projections_for_nested_compositions - IN PROGRESS

* • test_composition.py:
  - add test_add_multiple_projections_for_nested_compositions - passes

* -

* -

* • compositioninterfacemechanism.py: add figure and example

* • composition.py:
  - get_inputs_format(): add method
  - run():  allow inputs arg to take names of nodes

* • composition.py:
  - get_inputs_format():
    - implemented num_trials arg
    - TBI: nested and labels

* -

* • composition.py
  - get_input_format(): implement show_nested_input_nodes

* • composition.py
  - get_input_format(): implement use_labels

* -

* -

* -

* -

* -

* -

* -

* -

* -

* -

* -

* • composition.py
  get_input_format() - working; TBD: tests and documentation in composition docstring

* • composition.py
  get_results_format() - working; TBD: tests and documentation in composition docstring

* -

* • composition.py: add error messages to _parse_label() and _validate_single_input()

* • composition.py: add error messages to _parse_label() and _validate_single_input()

* -

* • composition.py: docstring mods

* • composition.py - reorganize docstring section on execution

* -

* -

* -

* -

* • test_composition.py / test_input_labels_and_no_orphaning_of_nested_output_nodes:
  added tests for lables in input

* • composition.py: _validate_single_input - get rid of tests (taken care of in _parse_labels)

* • test_composition.py/test_input_labels_and_results_by_node_and_no_orphaning_of_nested_output_nodes:
  - renamed, add test for get_results_by_node

* • composition.py
  - _parse_labels:  suppress warning about targets if no learning_components in pway

* -

* • composition.py: further docstring updates for get_input_format() and get_results_by_node()

* -

* -

* -

* -

* -

* • composition.py
  - get_results_by_node():  add use_labels option

Co-authored-by: jdcpni <pniintel55>
Co-authored-by: Katherine Mantel <[email protected]>
@jdcpni jdcpni temporarily deployed to github-pages December 21, 2021 18:48 Inactive
@github-actions
Copy link

This PR causes the following changes to the html docs (ubuntu-latest-3.7-x64):

diff -r docs-base/.buildinfo docs-head/.buildinfo
3c3
< config: e4eaff8bd460a1755b5775922fbff125
---
> config: 93a36d7daeeffc980fdbe13b5661e43b
diff -r docs-base/AGTControlMechanism.html docs-head/AGTControlMechanism.html
232c232
< <p>An AGTControlMechanism is a <a class="reference internal" href="ControlMechanism.html"><span class="doc">ControlMechanism</span></a> that uses an ObjectiveMechanism with a <code class="xref any docutils literal notranslate"><span class="pre">DualAdaptiveIntegrator</span></code>
---
> <p>An AGTControlMechanism is a <a class="reference internal" href="ControlMechanism.html"><span class="doc">ControlMechanism</span></a> that uses an ObjectiveMechanism with a <a class="reference internal" href="IntegratorFunctions.html#psyneulink.core.components.functions.stateful.integratorfunctions.DualAdaptiveIntegrator" title="psyneulink.core.components.functions.stateful.integratorfunctions.DualAdaptiveIntegrator"><code class="xref any py py-class docutils literal notranslate"><span class="pre">DualAdaptiveIntegrator</span></code></a>
234c234
< to regulate the <code class="xref any docutils literal notranslate"><span class="pre">mode</span></code> parameter of its <code class="xref any docutils literal notranslate"><span class="pre">FitzHughNagumoIntegrator</span></code> Function, it implements a form of the
---
> to regulate the <a class="reference internal" href="IntegratorFunctions.html#psyneulink.core.components.functions.stateful.integratorfunctions.FitzHughNagumoIntegrator.mode" title="psyneulink.core.components.functions.stateful.integratorfunctions.FitzHughNagumoIntegrator.mode"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">mode</span></code></a> parameter of its <a class="reference internal" href="IntegratorFunctions.html#psyneulink.core.components.functions.stateful.integratorfunctions.FitzHughNagumoIntegrator" title="psyneulink.core.components.functions.stateful.integratorfunctions.FitzHughNagumoIntegrator"><code class="xref any py py-class docutils literal notranslate"><span class="pre">FitzHughNagumoIntegrator</span></code></a> Function, it implements a form of the
244c244
< <code class="xref any docutils literal notranslate"><span class="pre">DualAdaptiveIntegrator</span></code> Function as its <a class="reference internal" href="ObjectiveMechanism.html#psyneulink.core.components.mechanisms.processing.objectivemechanism.ObjectiveMechanism.function" title="psyneulink.core.components.mechanisms.processing.objectivemechanism.ObjectiveMechanism.function"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">function</span></code></a>.</p>
---
> <a class="reference internal" href="IntegratorFunctions.html#psyneulink.core.components.functions.stateful.integratorfunctions.DualAdaptiveIntegrator" title="psyneulink.core.components.functions.stateful.integratorfunctions.DualAdaptiveIntegrator"><code class="xref any py py-class docutils literal notranslate"><span class="pre">DualAdaptiveIntegrator</span></code></a> Function as its <a class="reference internal" href="ObjectiveMechanism.html#psyneulink.core.components.mechanisms.processing.objectivemechanism.ObjectiveMechanism.function" title="psyneulink.core.components.mechanisms.processing.objectivemechanism.ObjectiveMechanism.function"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">function</span></code></a>.</p>
259c259
< ObjectiveMechanism is created automatically when the AGTControlMechanism is created, using a <code class="xref any docutils literal notranslate"><span class="pre">DualAdaptiveIntegrator</span></code>
---
> ObjectiveMechanism is created automatically when the AGTControlMechanism is created, using a <a class="reference internal" href="IntegratorFunctions.html#psyneulink.core.components.functions.stateful.integratorfunctions.DualAdaptiveIntegrator" title="psyneulink.core.components.functions.stateful.integratorfunctions.DualAdaptiveIntegrator"><code class="xref any py py-class docutils literal notranslate"><span class="pre">DualAdaptiveIntegrator</span></code></a>
326c326
< <code class="xref any docutils literal notranslate"><span class="pre">DualAdaptiveIntegrator</span></code> as is <a class="reference internal" href="ObjectiveMechanism.html#psyneulink.core.components.mechanisms.processing.objectivemechanism.ObjectiveMechanism.function" title="psyneulink.core.components.mechanisms.processing.objectivemechanism.ObjectiveMechanism.function"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">function</span></code></a>.</p>
---
> <a class="reference internal" href="IntegratorFunctions.html#psyneulink.core.components.functions.stateful.integratorfunctions.DualAdaptiveIntegrator" title="psyneulink.core.components.functions.stateful.integratorfunctions.DualAdaptiveIntegrator"><code class="xref any py py-class docutils literal notranslate"><span class="pre">DualAdaptiveIntegrator</span></code></a> as is <a class="reference internal" href="ObjectiveMechanism.html#psyneulink.core.components.mechanisms.processing.objectivemechanism.ObjectiveMechanism.function" title="psyneulink.core.components.mechanisms.processing.objectivemechanism.ObjectiveMechanism.function"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">function</span></code></a>.</p>
diff -r docs-base/AutoAssociativeLearningMechanism.html docs-head/AutoAssociativeLearningMechanism.html
228c228
< <p>An AutoAssociativeLearningMechanism is a subclass of <a class="reference internal" href="LearningMechanism.html"><span class="doc">Learning Mechanism</span></a>, modified for use with a
---
> <p>An AutoAssociativeLearningMechanism is a subclass of <a class="reference internal" href="LearningMechanism.html"><span class="doc">LearningMechanism</span></a>, modified for use with a
239c239
< <p>An AutoAssociativeLearningMechanism is identical to a <a class="reference internal" href="LearningMechanism.html"><span class="doc">Learning Mechanism</span></a> in all respects except the following:</p>
---
> <p>An AutoAssociativeLearningMechanism is identical to a <a class="reference internal" href="LearningMechanism.html"><span class="doc">LearningMechanism</span></a> in all respects except the following:</p>
257c257
< to the weight change matrix;  as with a standard <a class="reference internal" href="LearningMechanism.html"><span class="doc">Learning Mechanism</span></a>, a scalar can also be specified to scale
---
> to the weight change matrix;  as with a standard <a class="reference internal" href="LearningMechanism.html"><span class="doc">LearningMechanism</span></a>, a scalar can also be specified to scale
265c265
< <p>An AutoAssociativeLearningMechanism executes in the same manner as standard <a class="reference internal" href="LearningMechanism.html"><span class="doc">Learning Mechanism</span></a>, with two exceptions:
---
> <p>An AutoAssociativeLearningMechanism executes in the same manner as standard <a class="reference internal" href="LearningMechanism.html"><span class="doc">LearningMechanism</span></a>, with two exceptions:
282c282
< <dd><p>Implements a <a class="reference internal" href="LearningMechanism.html"><span class="doc">Learning Mechanism</span></a> that modifies the <a class="reference internal" href="MappingProjection.html#psyneulink.core.components.projections.pathway.mappingprojection.MappingProjection.matrix" title="psyneulink.core.components.projections.pathway.mappingprojection.MappingProjection.matrix"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">matrix</span></code></a> parameter of an
---
> <dd><p>Implements a <a class="reference internal" href="LearningMechanism.html"><span class="doc">LearningMechanism</span></a> that modifies the <a class="reference internal" href="MappingProjection.html#psyneulink.core.components.projections.pathway.mappingprojection.MappingProjection.matrix" title="psyneulink.core.components.projections.pathway.mappingprojection.MappingProjection.matrix"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">matrix</span></code></a> parameter of an
418c418
< <a class="reference internal" href="LearningMechanism.html"><span class="doc">Learning Mechanism</span></a>, it can be assigned additional LearningSignals and/or LearningProjections to train
---
> <a class="reference internal" href="LearningMechanism.html"><span class="doc">LearningMechanism</span></a>, it can be assigned additional LearningSignals and/or LearningProjections to train
diff -r docs-base/AutodiffComposition.html docs-head/AutodiffComposition.html
389,391c389,392
< <li><p><strong>num_trials</strong> (<em>int</em><em> (</em><em>default=None</em><em>)</em>) – typically, the composition will infer the number of trials from the length of its input specification.
< To reuse the same inputs across many trials, you may specify an input dictionary with lists of length 1,
< or use default inputs, and select a number of trials with num_trials.</p></li>
---
> <li><p><strong>num_trials</strong> (<em>int</em><em> (</em><em>default=None</em><em>)</em>) – typically, the Composition infers the number of trials to execute from the length of its input
> specification.  However, <strong>num_trials</strong> can be used to enforce an exact number of trials to execute;
> if it is greater than there are inputs then inputs will be repeated (see <a class="reference internal" href="Composition.html#composition-execution-inputs"><span class="std std-ref">Composition Inputs</span></a>
> for additional information).</p></li>
471,474c472,477
< <dd class="field-even"><p><strong>output value of the final Mechanism executed in the Composition</strong></p>
< </dd>
< <dt class="field-odd">Return type</dt>
< <dd class="field-odd"><p>various</p>
---
> <dd class="field-even"><p><ul class="simple">
> <li><p><strong>output_values</strong> (<em>List</em>)</p></li>
> <li><p><em>These are the values of the Composition’s output_CIM.output_ports, excluding those the source of which</em></p></li>
> <li><p><em>are from a (potentially nested) Node with NodeRole.PROBE in its enclosing Composition.</em></p></li>
> </ul>
> </p>
diff -r docs-base/BasicsAndPrimer.html docs-head/BasicsAndPrimer.html
443c443
< assigning <code class="xref any docutils literal notranslate"><span class="pre">DriftDiffusionIntegrator</span></code> as the Mechanism’s <a class="reference internal" href="DDM.html#psyneulink.library.components.mechanisms.processing.integrator.ddm.DDM.function" title="psyneulink.library.components.mechanisms.processing.integrator.ddm.DDM.function"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">function</span></code></a> and, in the call to the Composition’s
---
> assigning <a class="reference internal" href="IntegratorFunctions.html#psyneulink.core.components.functions.stateful.integratorfunctions.DriftDiffusionIntegrator" title="psyneulink.core.components.functions.stateful.integratorfunctions.DriftDiffusionIntegrator"><code class="xref any py py-class docutils literal notranslate"><span class="pre">DriftDiffusionIntegrator</span></code></a> as the Mechanism’s <a class="reference internal" href="DDM.html#psyneulink.library.components.mechanisms.processing.integrator.ddm.DDM.function" title="psyneulink.library.components.mechanisms.processing.integrator.ddm.DDM.function"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">function</span></code></a> and, in the call to the Composition’s
459c459
< <p>The output is now the result of the <code class="xref any docutils literal notranslate"><span class="pre">DriftDiffusionIntegrator</span></code>, which is the value of the decision variable when it
---
> <p>The output is now the result of the <a class="reference internal" href="IntegratorFunctions.html#psyneulink.core.components.functions.stateful.integratorfunctions.DriftDiffusionIntegrator" title="psyneulink.core.components.functions.stateful.integratorfunctions.DriftDiffusionIntegrator"><code class="xref any py py-class docutils literal notranslate"><span class="pre">DriftDiffusionIntegrator</span></code></a>, which is the value of the decision variable when it
971c971
< <p>PsyNeuLink has a native class – <a class="reference internal" href="LearningMechanism.html"><span class="doc">Learning Mechanism</span></a> – that can be used to implement various forms of learning,
---
> <p>PsyNeuLink has a native class – <a class="reference internal" href="LearningMechanism.html"><span class="doc">LearningMechanism</span></a> – that can be used to implement various forms of learning,
1119c1119
< <a class="reference internal" href="index.html#tutorial"><span class="std std-ref">Tutorial</span></a> provides a more thorough, interactive introduction to its use, and the <a class="reference internal" href="UserGuide.html"><span class="doc">User's Guide</span></a> provides
---
> <a class="reference internal" href="index_logo_with_text.html#tutorial"><span class="std std-ref">Tutorial</span></a> provides a more thorough, interactive introduction to its use, and the <a class="reference internal" href="UserGuide.html"><span class="doc">User's Guide</span></a> provides
diff -r docs-base/CombinationFunctions.html docs-head/CombinationFunctions.html
223c223
< <dd><p id="concatenate">Concatenates items in outer dimension (axis 0) of of <code class="xref any docutils literal notranslate"><span class="pre">variable</span></code> into a single array,
---
> <dd><p id="concatenate">Concatenates items in outer dimension (axis 0) of <code class="xref any docutils literal notranslate"><span class="pre">variable</span></code> into a single array,
225c225
< <p><code class="xref any docutils literal notranslate"><span class="pre">function</span></code> returns a 1d array with lenght equal to the sum of the lengths of the items
---
> <p><code class="xref any docutils literal notranslate"><span class="pre">function</span></code> returns a 1d array with length equal to the sum of the lengths of the items
diff -r docs-base/Component.html docs-head/Component.html
490c490
< arguments, so that the relevant <code class="xref any docutils literal notranslate"><span class="pre">initializer</span></code> attributes (or their equivalents
---
> arguments, so that the relevant <a class="reference internal" href="IntegratorFunctions.html#psyneulink.core.components.functions.stateful.integratorfunctions.IntegratorFunction.initializer" title="psyneulink.core.components.functions.stateful.integratorfunctions.IntegratorFunction.initializer"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">initializer</span></code></a> attributes (or their equivalents
496c496
< Mechanisms (see <a class="reference internal" href="Composition.html#composition-reset"><span class="std std-ref">Resetting Parameters of stateful</span></a>)</p>
---
> Mechanisms (see <a class="reference internal" href="Composition.html#composition-reset"><span class="std std-ref">Resetting Stateful Parameters</span></a>)</p>
747c747
< <dd class="field-odd"><p><a class="reference internal" href="RegressionCFA.html#psyneulink.library.compositions.regressioncfa.RegressionCFA.Parameters" title="psyneulink.library.compositions.regressioncfa.RegressionCFA.Parameters">Parameters</a></p>
---
> <dd class="field-odd"><p><a class="reference internal" href="CompositionInterfaceMechanism.html#psyneulink.core.components.mechanisms.processing.compositioninterfacemechanism.CompositionInterfaceMechanism.Parameters" title="psyneulink.core.components.mechanisms.processing.compositioninterfacemechanism.CompositionInterfaceMechanism.Parameters">Parameters</a></p>
1139c1139
< <dd><p>If the component’s execute method involves execution of an <code class="xref any docutils literal notranslate"><span class="pre">IntegratorFunction</span></code> Function, this method
---
> <dd><p>If the component’s execute method involves execution of an <a class="reference internal" href="IntegratorFunctions.html#psyneulink.core.components.functions.stateful.integratorfunctions.IntegratorFunction" title="psyneulink.core.components.functions.stateful.integratorfunctions.IntegratorFunction"><code class="xref any py py-class docutils literal notranslate"><span class="pre">IntegratorFunc
...

See CI logs for the full diff.

@lgtm-com
Copy link
Contributor

lgtm-com bot commented Dec 21, 2021

This pull request introduces 14 alerts and fixes 48 when merging cc6242b into 912f691 - view on LGTM.com

new alerts:

  • 4 for Except block handles 'BaseException'
  • 3 for Unused local variable
  • 2 for Modification of dictionary returned by locals()
  • 1 for Wrong name for an argument in a call
  • 1 for Comparison using is when operands support `__eq__`
  • 1 for Unreachable code
  • 1 for Module is imported with 'import' and 'import from'
  • 1 for `__init__` method calls overridden method

fixed alerts:

  • 33 for Unused import
  • 12 for Comparison using is when operands support `__eq__`
  • 1 for Wrong name for an argument in a call
  • 1 for Except block handles 'BaseException'
  • 1 for `__init__` method calls overridden method

kmantel and others added 4 commits December 21, 2021 14:44
uses same suffixing to add ports for any subfunctions of subfunctions
instead of just those of the primary object.
Create ParameterPorts for all functions of functions
@kmantel kmantel temporarily deployed to github-pages December 21, 2021 21:37 Inactive
@github-actions
Copy link

This PR causes the following changes to the html docs (ubuntu-latest-3.7-x64):

diff -r docs-base/.buildinfo docs-head/.buildinfo
3c3
< config: e4eaff8bd460a1755b5775922fbff125
---
> config: 93a36d7daeeffc980fdbe13b5661e43b
diff -r docs-base/AGTControlMechanism.html docs-head/AGTControlMechanism.html
232c232
< <p>An AGTControlMechanism is a <a class="reference internal" href="ControlMechanism.html"><span class="doc">ControlMechanism</span></a> that uses an ObjectiveMechanism with a <code class="xref any docutils literal notranslate"><span class="pre">DualAdaptiveIntegrator</span></code>
---
> <p>An AGTControlMechanism is a <a class="reference internal" href="ControlMechanism.html"><span class="doc">ControlMechanism</span></a> that uses an ObjectiveMechanism with a <a class="reference internal" href="IntegratorFunctions.html#psyneulink.core.components.functions.stateful.integratorfunctions.DualAdaptiveIntegrator" title="psyneulink.core.components.functions.stateful.integratorfunctions.DualAdaptiveIntegrator"><code class="xref any py py-class docutils literal notranslate"><span class="pre">DualAdaptiveIntegrator</span></code></a>
234c234
< to regulate the <code class="xref any docutils literal notranslate"><span class="pre">mode</span></code> parameter of its <code class="xref any docutils literal notranslate"><span class="pre">FitzHughNagumoIntegrator</span></code> Function, it implements a form of the
---
> to regulate the <a class="reference internal" href="IntegratorFunctions.html#psyneulink.core.components.functions.stateful.integratorfunctions.FitzHughNagumoIntegrator.mode" title="psyneulink.core.components.functions.stateful.integratorfunctions.FitzHughNagumoIntegrator.mode"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">mode</span></code></a> parameter of its <a class="reference internal" href="IntegratorFunctions.html#psyneulink.core.components.functions.stateful.integratorfunctions.FitzHughNagumoIntegrator" title="psyneulink.core.components.functions.stateful.integratorfunctions.FitzHughNagumoIntegrator"><code class="xref any py py-class docutils literal notranslate"><span class="pre">FitzHughNagumoIntegrator</span></code></a> Function, it implements a form of the
244c244
< <code class="xref any docutils literal notranslate"><span class="pre">DualAdaptiveIntegrator</span></code> Function as its <a class="reference internal" href="ObjectiveMechanism.html#psyneulink.core.components.mechanisms.processing.objectivemechanism.ObjectiveMechanism.function" title="psyneulink.core.components.mechanisms.processing.objectivemechanism.ObjectiveMechanism.function"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">function</span></code></a>.</p>
---
> <a class="reference internal" href="IntegratorFunctions.html#psyneulink.core.components.functions.stateful.integratorfunctions.DualAdaptiveIntegrator" title="psyneulink.core.components.functions.stateful.integratorfunctions.DualAdaptiveIntegrator"><code class="xref any py py-class docutils literal notranslate"><span class="pre">DualAdaptiveIntegrator</span></code></a> Function as its <a class="reference internal" href="ObjectiveMechanism.html#psyneulink.core.components.mechanisms.processing.objectivemechanism.ObjectiveMechanism.function" title="psyneulink.core.components.mechanisms.processing.objectivemechanism.ObjectiveMechanism.function"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">function</span></code></a>.</p>
259c259
< ObjectiveMechanism is created automatically when the AGTControlMechanism is created, using a <code class="xref any docutils literal notranslate"><span class="pre">DualAdaptiveIntegrator</span></code>
---
> ObjectiveMechanism is created automatically when the AGTControlMechanism is created, using a <a class="reference internal" href="IntegratorFunctions.html#psyneulink.core.components.functions.stateful.integratorfunctions.DualAdaptiveIntegrator" title="psyneulink.core.components.functions.stateful.integratorfunctions.DualAdaptiveIntegrator"><code class="xref any py py-class docutils literal notranslate"><span class="pre">DualAdaptiveIntegrator</span></code></a>
326c326
< <code class="xref any docutils literal notranslate"><span class="pre">DualAdaptiveIntegrator</span></code> as is <a class="reference internal" href="ObjectiveMechanism.html#psyneulink.core.components.mechanisms.processing.objectivemechanism.ObjectiveMechanism.function" title="psyneulink.core.components.mechanisms.processing.objectivemechanism.ObjectiveMechanism.function"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">function</span></code></a>.</p>
---
> <a class="reference internal" href="IntegratorFunctions.html#psyneulink.core.components.functions.stateful.integratorfunctions.DualAdaptiveIntegrator" title="psyneulink.core.components.functions.stateful.integratorfunctions.DualAdaptiveIntegrator"><code class="xref any py py-class docutils literal notranslate"><span class="pre">DualAdaptiveIntegrator</span></code></a> as is <a class="reference internal" href="ObjectiveMechanism.html#psyneulink.core.components.mechanisms.processing.objectivemechanism.ObjectiveMechanism.function" title="psyneulink.core.components.mechanisms.processing.objectivemechanism.ObjectiveMechanism.function"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">function</span></code></a>.</p>
diff -r docs-base/AutoAssociativeLearningMechanism.html docs-head/AutoAssociativeLearningMechanism.html
228c228
< <p>An AutoAssociativeLearningMechanism is a subclass of <a class="reference internal" href="LearningMechanism.html"><span class="doc">Learning Mechanism</span></a>, modified for use with a
---
> <p>An AutoAssociativeLearningMechanism is a subclass of <a class="reference internal" href="LearningMechanism.html"><span class="doc">LearningMechanism</span></a>, modified for use with a
239c239
< <p>An AutoAssociativeLearningMechanism is identical to a <a class="reference internal" href="LearningMechanism.html"><span class="doc">Learning Mechanism</span></a> in all respects except the following:</p>
---
> <p>An AutoAssociativeLearningMechanism is identical to a <a class="reference internal" href="LearningMechanism.html"><span class="doc">LearningMechanism</span></a> in all respects except the following:</p>
257c257
< to the weight change matrix;  as with a standard <a class="reference internal" href="LearningMechanism.html"><span class="doc">Learning Mechanism</span></a>, a scalar can also be specified to scale
---
> to the weight change matrix;  as with a standard <a class="reference internal" href="LearningMechanism.html"><span class="doc">LearningMechanism</span></a>, a scalar can also be specified to scale
265c265
< <p>An AutoAssociativeLearningMechanism executes in the same manner as standard <a class="reference internal" href="LearningMechanism.html"><span class="doc">Learning Mechanism</span></a>, with two exceptions:
---
> <p>An AutoAssociativeLearningMechanism executes in the same manner as standard <a class="reference internal" href="LearningMechanism.html"><span class="doc">LearningMechanism</span></a>, with two exceptions:
282c282
< <dd><p>Implements a <a class="reference internal" href="LearningMechanism.html"><span class="doc">Learning Mechanism</span></a> that modifies the <a class="reference internal" href="MappingProjection.html#psyneulink.core.components.projections.pathway.mappingprojection.MappingProjection.matrix" title="psyneulink.core.components.projections.pathway.mappingprojection.MappingProjection.matrix"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">matrix</span></code></a> parameter of an
---
> <dd><p>Implements a <a class="reference internal" href="LearningMechanism.html"><span class="doc">LearningMechanism</span></a> that modifies the <a class="reference internal" href="MappingProjection.html#psyneulink.core.components.projections.pathway.mappingprojection.MappingProjection.matrix" title="psyneulink.core.components.projections.pathway.mappingprojection.MappingProjection.matrix"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">matrix</span></code></a> parameter of an
418c418
< <a class="reference internal" href="LearningMechanism.html"><span class="doc">Learning Mechanism</span></a>, it can be assigned additional LearningSignals and/or LearningProjections to train
---
> <a class="reference internal" href="LearningMechanism.html"><span class="doc">LearningMechanism</span></a>, it can be assigned additional LearningSignals and/or LearningProjections to train
diff -r docs-base/AutodiffComposition.html docs-head/AutodiffComposition.html
389,391c389,392
< <li><p><strong>num_trials</strong> (<em>int</em><em> (</em><em>default=None</em><em>)</em>) – typically, the composition will infer the number of trials from the length of its input specification.
< To reuse the same inputs across many trials, you may specify an input dictionary with lists of length 1,
< or use default inputs, and select a number of trials with num_trials.</p></li>
---
> <li><p><strong>num_trials</strong> (<em>int</em><em> (</em><em>default=None</em><em>)</em>) – typically, the Composition infers the number of trials to execute from the length of its input
> specification.  However, <strong>num_trials</strong> can be used to enforce an exact number of trials to execute;
> if it is greater than there are inputs then inputs will be repeated (see <a class="reference internal" href="Composition.html#composition-execution-inputs"><span class="std std-ref">Composition Inputs</span></a>
> for additional information).</p></li>
471,474c472,477
< <dd class="field-even"><p><strong>output value of the final Mechanism executed in the Composition</strong></p>
< </dd>
< <dt class="field-odd">Return type</dt>
< <dd class="field-odd"><p>various</p>
---
> <dd class="field-even"><p><ul class="simple">
> <li><p><strong>output_values</strong> (<em>List</em>)</p></li>
> <li><p><em>These are the values of the Composition’s output_CIM.output_ports, excluding those the source of which</em></p></li>
> <li><p><em>are from a (potentially nested) Node with NodeRole.PROBE in its enclosing Composition.</em></p></li>
> </ul>
> </p>
diff -r docs-base/BasicsAndPrimer.html docs-head/BasicsAndPrimer.html
443c443
< assigning <code class="xref any docutils literal notranslate"><span class="pre">DriftDiffusionIntegrator</span></code> as the Mechanism’s <a class="reference internal" href="DDM.html#psyneulink.library.components.mechanisms.processing.integrator.ddm.DDM.function" title="psyneulink.library.components.mechanisms.processing.integrator.ddm.DDM.function"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">function</span></code></a> and, in the call to the Composition’s
---
> assigning <a class="reference internal" href="IntegratorFunctions.html#psyneulink.core.components.functions.stateful.integratorfunctions.DriftDiffusionIntegrator" title="psyneulink.core.components.functions.stateful.integratorfunctions.DriftDiffusionIntegrator"><code class="xref any py py-class docutils literal notranslate"><span class="pre">DriftDiffusionIntegrator</span></code></a> as the Mechanism’s <a class="reference internal" href="DDM.html#psyneulink.library.components.mechanisms.processing.integrator.ddm.DDM.function" title="psyneulink.library.components.mechanisms.processing.integrator.ddm.DDM.function"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">function</span></code></a> and, in the call to the Composition’s
459c459
< <p>The output is now the result of the <code class="xref any docutils literal notranslate"><span class="pre">DriftDiffusionIntegrator</span></code>, which is the value of the decision variable when it
---
> <p>The output is now the result of the <a class="reference internal" href="IntegratorFunctions.html#psyneulink.core.components.functions.stateful.integratorfunctions.DriftDiffusionIntegrator" title="psyneulink.core.components.functions.stateful.integratorfunctions.DriftDiffusionIntegrator"><code class="xref any py py-class docutils literal notranslate"><span class="pre">DriftDiffusionIntegrator</span></code></a>, which is the value of the decision variable when it
858c858
< of a <a class="reference internal" href="Mechanism.html"><span class="doc">Mechanism</span></a> or a <a class="reference internal" href="Projection.html"><span class="doc">Projection</span></a> is modulable, it is assigned a <a class="reference internal" href="ParameterPort.html"><span class="doc">ParameterPort</span></a> – this is a
---
> of a <a class="reference internal" href="Mechanism.html"><span class="doc">Mechanism</span></a> or a <a class="reference internal" href="Projection.html"><span class="doc">Projection</span></a> is modulable, it may be assigned a <a class="reference internal" href="ParameterPort.html"><span class="doc">ParameterPort</span></a> – this is a
893a894,902
> <p>Some Parameters may be modulable, but not <em>modulated</em> by a
> ParameterPort, because ParameterPorts are only created for Parameters
> whose values are numeric at the time of Component construction. For
> example, <a class="reference internal" href="TransferMechanism.html#psyneulink.core.components.mechanisms.processing.transfermechanism.TransferMechanism.termination_threshold" title="psyneulink.core.components.mechanisms.processing.transfermechanism.TransferMechanism.termination_threshold"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">TransferMechanism.termination_threshold</span></code></a> has a default value
> of None and will not have a ParameterPort by default. Similarly, when
> <a class="reference internal" href="TransferMechanism.html#psyneulink.core.components.mechanisms.processing.transfermechanism.TransferMechanism.noise" title="psyneulink.core.components.mechanisms.processing.transfermechanism.TransferMechanism.noise"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">noise</span></code></a> is set to a function or value
> containing a function, it will not have an associated ParameterPort.</p>
> <p>In this case, dot notation for these modulable Parameters will behave
> the same as for non-modulable Parameters.</p>
971c980
< <p>PsyNeuLink has a native class – <a class="reference internal" href="LearningMechanism.html"><span class="doc">Learning Mechanism</span></a> – that can be used to implement various forms of learning,
---
> <p>PsyNeuLink has a native class – <a class="reference internal" href="LearningMechanism.html"><span class="doc">LearningMechanism</span></a> – that can be used to implement various forms of learning,
1119c1128
< <a class="reference internal" href="index.html#tutorial"><span class="std std-ref">Tutorial</span></a> provides a more thorough, interactive introduction to its use, and the <a class="reference internal" href="UserGuide.html"><span class="doc">User's Guide</span></a> provides
---
> <a class="reference internal" href="index_logo_with_text.html#tutorial"><span class="std std-ref">Tutorial</span></a> provides a more thorough, interactive introduction to its use, and the <a class="reference internal" href="UserGuide.html"><span class="doc">User's Guide</span></a> provides
diff -r docs-base/CombinationFunctions.html docs-head/CombinationFunctions.html
223c223
< <dd><p id="concatenate">Concatenates items in outer dimension (axis 0) of of <code class="xref any docutils literal notranslate"><span class="pre">variable</span></code> into a single array,
---
> <dd><p id="concatenate">Concatenates items in outer dimension (axis 0) of <code class="xref any docutils literal notranslate"><span class="pre">variable</span></code> into a single array,
225c225
< <p><code class="xref any docutils literal notranslate"><span class="pre">function</span></code> returns a 1d array with lenght equal to the sum of the lengths of the items
---
> <p><code class="xref any docutils literal notranslate"><span class="pre">function</span></code> returns a 1d array with length equal to the sum of the lengths of the items
diff -r docs-base/Component.html docs-head/Component.html
490c490
< arguments, so that the relevant <code class="xref any docutils literal notranslate"><span class="pre">initializer</span></code> attributes (or their equivalents

...

See CI logs for the full diff.

@lgtm-com
Copy link
Contributor

lgtm-com bot commented Dec 21, 2021

This pull request introduces 14 alerts and fixes 48 when merging 47abfd9 into 912f691 - view on LGTM.com

new alerts:

  • 4 for Except block handles 'BaseException'
  • 3 for Unused local variable
  • 2 for Modification of dictionary returned by locals()
  • 1 for Wrong name for an argument in a call
  • 1 for Comparison using is when operands support `__eq__`
  • 1 for Unreachable code
  • 1 for Module is imported with 'import' and 'import from'
  • 1 for `__init__` method calls overridden method

fixed alerts:

  • 33 for Unused import
  • 12 for Comparison using is when operands support `__eq__`
  • 1 for Wrong name for an argument in a call
  • 1 for Except block handles 'BaseException'
  • 1 for `__init__` method calls overridden method

@kmantel kmantel requested a review from jdcpni December 21, 2021 23:16
* -

* • composition.py:
  _instantiate_control_projections:
     weird requirement for double-call to controller._instantiate_control_signal

* • test_paremtercomposition.py:
  restored parameter spec that causes crash ('threshold',Decision2)

* ª Attempt to fix problem with partially overlapping local and ocm control specs

- composition.py
  - _get_control_signals_for_composition:  (see 11/20/21)
      - added (but commented out change) to "if node.controller" to "if not node.controller"
      - changed append to extend
  - _instantiation_control_projection:
      - got rid of try and except double-call to controller._instantiate_control_signals
      -  outdented call to self.controller._activate_projections_for_composition at end

- controlmechanism.py:
    - _check_for_duplicates:  add warning and return duplicates

- optimizationcontrolmechanism._instantiate_control_signals:
    - add call to self.agent_rep._get_control_signals_for_composition() to get local control specs (on mechs in comp)
    - eliminate duplicates with control_signal specs on OCM
    - instantiate local + ocm control_signals

- parameterestimationcomposition.py
  - added context to various calls

* see later commit

* see later commit

* see later commit

* see later commit

* - This branch passes all tests except:
   - test_parameterestimationcomposition
   - test_composition/test_partially_overlapping_control_specs (ADDED IN THIS COMMINT)

- All relevant changes to this branch are marked as "11/21/21."
  However, most are commented out as they break other things.

- The tests above both involve local control specifications (on mechanism within a nested comp)
  and on the OCM for the outer composition, some of which are for the same nested mechs

- Both tests fail with:
   "AttributeError: 'NoneType' object has no attribute '_get_by_time_scale'" (in component.py LINE 3276)
   This may be due to a problem with context setting, since the error is because the modulation Parameter
   of the ControlProjection is returning "None" rather than "multiplicative_param" (when called with get(context)),
   whereas "multiplicative_param" is returned with a call to get() (i.e., with no context specified)

- Most of test_partially_overlapping_control_specs is passed if
   changes marked "11/21/21 NEW" in optimizationcontrolmechanism.py (LINE 1390) are implemented,
   but it does not properly route ControlProjections through parameter_CIMS (see last assert in test).
   Furthermore, test_parameterestimationcompsition fails with the mod param error, even though the
   model has similar structure (i.e., outer composition -- in this case a ParameterEstimationComposition)
   with an OCM that is given control specs that overlap with ones in a nested composition.

- There are also several other things in composition I found puzzling and tried modifying, but that cuased failures:
  - _get_control_signals_for_composition():
      - seems "if node.controller" should be "if **not** node.controller" (emphasis added just for comment)
      - "append" should be "extend"
  - _instantiate_control_projection():
      -  call to self.controller._activate_projections_for_composition (at end of method) should not be indented

* - small mods; don't impact anything relevant to prior commit message

* - small mods; don't impact anything relevant to prior commit message

* - small mods; don't impact anything relevant to prior commit message

* - finished adding formatting regions to composition.py

* -

* • composition.py:
  - rename _check_projection_initialization_status -> _check_controller_initialization_status
  - add _check_nodes_initialization_status(context=context)
    (and calls it with _check_controller_initialization_status)

* • show_graph.py:  addressed bug associated with ocm.allow_direct_probe

* • show_graph.py:  addressed bug associated with ocm.allow_direct_probe

* -

* Composition: add_controller: set METHOD as context source early

* -

* • composition.py
  retore append of control_signals in _instantiate_control_projections()

* • composition.py
  restore append of control_signals in _instantiate_control_projections()

• test_composition.py:
  add test_partially_overlapping_local_and_control_mech_control_specs_in_unnested_and_nested_comp

* • test_partially_overlapping_local_and_control_mech_control_specs_in_unnested_and_nested_comp():
  - added clear_registry() to allow names to be reused in both runs of test

* • composition.py
  docstring:  added projections entry to list of attributes
  - add_controller:  added call to _add_node_aux_components() for controller

* • composition.py
  _add_node_aux_components(): added deletion of item from aux_components if instantiated

* • composition.py
  - comment out _add_node_aux_components() (causing new failures)
  - move _instantiate_control_projections to be with _instantiate_control_projections,
       after self.add_node(self.controller.objective_mechanism (to be more orderly)

* -

* - confirm that it passes all tests exception test_composition/test_partially_overlapping...
  (with addition of _add_aux_components in add_controller commented out)

* • composition.py:  some more fixed to add_controller that now fail only one test:
    - test_agent_rep_assignement_as_controller_and_replacement

* • Passes *all* current tests

* • composition.py:
  - add_controller:  few more minor mods;
  still passes all tests

* -

* -

* -

* • controlmechanism.py:
  - __init__: resrict specification to only one of control, modulatory_signals, or control_signals (synonyms)

* -

* • composition.py:  in progress fix of bug in instantiating shadow projections for ocm.state_input_ports

* • composition.py:
  - _get_original_senders():  added support for nested composition
    needs to be checked for more than one level
    needs to be refactored to be recursive

* • optimizationcontrolmechanism.py
  - _update_state_input_ports_for_controller:  fix invalid_state_features to allow input_CIM of nested comp in agent_rep

* -

* • composition.py
 - _get_original_senders: made recursive

* • test_show_graph.py: update for fixes

* -

* • tests:  passes all in test_show_graph.py and test_report.py

* Passes all tests

* - comment clean-up

* • composition.py
 - add_controller and _get_nested_node_CIM_port:
   added support for forced assignment of NodeRole.OUTPUT for nodes specified in OCM.monitor_for_control,
   but referenced 'allow_probes' attribute still needs to be implemented

* • composition.py, optimizationcontrolmechanism.py:
  allow_probes fully implemented

* • show_graph.py:  fixed bug causing extra projections to OCM

* • composition.py:
  - _update_shadow_projections(): fix handling of deep nesting

* • optimizationcontrolmechanism.py: add agent_rep_type property

* • optimizationcontrolmechanism.py:
  - state_feature_function -> state_feature_functions

* • optimizationcontrolmechanism.py:
  - _validate_params:  validate state_feature_functions
  - _update_state_input_ports_for_controller: implement assignment of state_feature_functions

* -

* -

* • Passes all tests except test_json with 'model_with_control'

* -

* • composition.py
  - add_projection:  delete instantiation of shadow projections (handled by _update_shadow_projections)

* • composition.py
  - add_projection:  delete instantiation of shadow projections (handled by _update_shadow_projections)
  - remove calls to _update_shadows_dict

* • composition.py
  - add_projection:  delete instantiation of shadow projections (handled by _update_shadow_projections)
  - remove calls to _update_shadows_dict

* -

* • test_two_origins_two_input_ports:  crashes on failure of C->B to update

* -

* • composition.py
  - added property shadowing_dict that has shadowing ports as keys and the ports they shadow as values
  - refactored _update_shadowing_projections to use shadowing_dict

* • optimizationcontrolmechanism.py
  - _update_state_input_ports:  modified validations for nested nodes;  still failing some tests

* • optimizationcontrolmechanism.py
  - _update_state_input_ports:
     more careful and informative validation that state_input_ports are in comp or nested comp and are INPUT nodes thereof;
     passes all tests except test_two_origins_two_input_ports as before

* • composition.py
  _get_invalid_aux_components():  defer all shadow projections until _update_shadow_projections

* • composition.py
  _get_invalid_aux_components():  bug fix in test for shadow projections

* Port: _remove_projection_to_port: don't reduce variable below length 1

even ports with no incoming projections have variable at least length 1

* • composition.py
  add_node(): marked (but haven't removed) code block instantiating shadow_projections
   that seems now to be redundant with _update_shadow_projection

* • show_graph.py
  - _assign_cim_components: supress showing projections not in composition

* • composition.py:
  _analyze_graph():  add extra call to _determine_node_roles after _update_shadow_projections
  _run():  moved block of code at beginning initializing scheduler to after
           _complete_init_of_partially_initialized_nodes and _analyze_graph()

• show_graph.py
  - add test to all loops on projections:  "if proj in composition.projection"

* • show_graph.py
  - add show_projections_not_in_composition option for debugging

* • composition.py
  _update_shadow_projections(): delete unused shadow projections and corresponding ports

* • composition.py
  _update_shadow_projections(): fix bug in deletion of unused shadow projections and ports

• test_show_graph:  tests failing, need mods to accomodate changes

* • composition.py:
  _analyze_graph():  add extra call to _determine_node_roles after _update_shadow_projections
  _run():  moved block of code at beginning initializing scheduler to after
           _complete_init_of_partially_initialized_nodes and _analyze_graph()

• show_graph.py
  - add test to all loops on projections:  "if proj in composition.projection"

* • show_graph.py
  fixes; now passes all show_graph tests

* -

* • composition.py
  _update_shadow_projections:  raise error for attempt to shadow INTERNAL Node of nested comp

* -

* -

* • test_composition.py
  implemented test_shadow_nested_nodes that tests shadowing of nested nodes

* -

* -

* -

* -

* • optimizationcontrolmechanism.py: docstring mods

* • composition.py:
  - add allow_probes and exclude_probes_from_output

* • composition.py:
  - docstring mods re: allow_probes

• optimizationcontrolmechanism.py:
  - allow_probes:  eliminate DIRECT setting
  - remove _parse_monitor_for_control_input_ports (no longer needed without allow_probes=DIRECT)

* • composition.py:
  - change "exclude_probes_from_output" -> "include_probes_in_output"

* • composition.py:
  - docstring mods re: allow_probes and include_probes_in_output

* • composition.py:
  - docstring mods re: allow_probes and include_probes_in_output

* • controlmechanism.py:
  - add allow_probes handling (moved from OCM)

• optimizationcontrolmechanism.py:
  - move allow_probes to controlmechanism.py

• composition.py:
  - refactor handling of allow_probes to permit for any ControlMechanism

• objectivemechanism.py:
  - add modulatory_mechanism attribute

* • controlmechanism.py:
  - add allow_probes handling (moved from OCM)

• optimizationcontrolmechanism.py:
  - move allow_probes to controlmechanism.py

• composition.py:
  - refactor handling of allow_probes to permit for any ControlMechanism
  - add _handle_allow_probes_for_control() to reconcile setting on Composition and ControlMechanism

• objectivemechanism.py:
  - add modulatory_mechanism attribute

* • composition.py
  add assignment of learning_mechanism to objective_mechanism.modulatory_mechanism for add_learning methods

* • docstring mods

* -

* -

* • optimizationcontrolmechanism.py: docstring revs

* -

* -

* • test_composition.py:
  - add test_unnested_PROBE
  - add test_nested_PROBES
    TBD: test include_probes_in_output

* -

* • composition.py
  - add_node():  support tuple with required_role

* -

* • composition.py:
  - _determine_node_roles:
     fix bug in which nested comp was prevented from being an OUTPUT Node if,
     in addition to Nodes that qualifed as OUTPUT, it also had nodes that projected
     to Nodes in an outer comp (making it look like it was INTERNAL)

* -

* • composition.py:
  - add_node(): enforce include_probes_in_output = True for nested Compositions
  - execute():
    - replace return of output_value with get_output_value()

* -

* • CompositionInterfaceMechanism.rst:
  - correct path ref

• compositioninterfacemechanism.py:
  - docstring fixes

* • compositioninterfacemechanism.py:
  - docstring edits

* -

* -

* -

* -

* -

* -

* -

* -

* -

* • composition.py:
  add_projection:  _parse_projection_spec -> _instantiate_projection_from_spec

* • composition.py:
  add_projection:  _parse_projection_spec -> _instantiate_projection_from_spec

* • composition.py
  - add_linear_processing_pathway:
    support one->many and many->one configurations in pathway specification
    (see docstring for method)

* -

* • composition.py
  _add_linear_processing_pathway, add_projection, _is_pathway_entry_spec:
  - support many->one and one->many projections between mech and comps in pathway spec:  working
  - support set of Projections as legal entry in pathway spec:  TBI

* • composition.py
  _add_linear_processing_pathway, add_projection, _is_pathway_entry_spec:
  - support many->one and one->many projections between mech and comps in pathway spec:  working
  - support set of Projections as legal entry in pathway spec:  TBI

* • show_graph.py
  _assign_cim_components(): fix bug in which comp1_output_cim->comp2_input_cim was skipped

* • compositioninterfacemechanism.py: docstring mod

* -

* • composition.py: minor formatting

* • composition.py
  add_linear_processing_pathway(): eliminate TARGET Nodes from one->many

* -

* • composition.py:
  - add_linear_processing_pathway(): add recursive search for nested INPUT and OUTPUT nodes

* • composition.py:
  - add_linear_processing_pathway():
    - exclude Target Nodes from search for INPUT nodes (handled by learning)
    - add recursive search for nested INPUT and OUTPUT nodes

* -

* -

* • composition.py
  add_projection:  working on adding support for projection sets

* -

* -

* • composition.py
  - add _get_nested_nodes_with_same_roles_at_all_levels
  - add_linear_processing_pathway:
    call _get_nested_nodes_with_same_roles_at_all_levels

* • composition.py
  - add_linear_processing_pathway:  add support for inline specification of set of Projections

* -

* -

* • composition.py
  add_linear_processing_pathway: refactored to support inline specification of sets of Projections

* • composition.py
  add_linear_processing_pathway: docstring edits for Projection set specification

* -

* -

* -

* -

* -

* • test_composition.py:
  - add test_add_multiple_projections_for_nested_compositions - IN PROGRESS

* • test_composition.py:
  - add test_add_multiple_projections_for_nested_compositions - passes

* -

* -

* • compositioninterfacemechanism.py: add figure and example

* • composition.py:
  - get_inputs_format(): add method
  - run():  allow inputs arg to take names of nodes

* • composition.py:
  - get_inputs_format():
    - implemented num_trials arg
    - TBI: nested and labels

* -

* • composition.py
  - get_input_format(): implement show_nested_input_nodes

* • composition.py
  - get_input_format(): implement use_labels

* -

* -

* -

* -

* -

* -

* -

* -

* -

* -

* -

* • composition.py
  get_input_format() - working; TBD: tests and documentation in composition docstring

* • composition.py
  get_results_format() - working; TBD: tests and documentation in composition docstring

* -

* • composition.py: add error messages to _parse_label() and _validate_single_input()

* • composition.py: add error messages to _parse_label() and _validate_single_input()

* -

* • composition.py: docstring mods

* • composition.py - reorganize docstring section on execution

* -

* -

* -

* -

* • test_composition.py / test_input_labels_and_no_orphaning_of_nested_output_nodes:
  added tests for lables in input

* • composition.py: _validate_single_input - get rid of tests (taken care of in _parse_labels)

* • test_composition.py/test_input_labels_and_results_by_node_and_no_orphaning_of_nested_output_nodes:
  - renamed, add test for get_results_by_node

* • composition.py
  - _parse_labels:  suppress warning about targets if no learning_components in pway

* -

* • composition.py: further docstring updates for get_input_format() and get_results_by_node()

* -

* -

* -

* -

* -

* • composition.py
  - get_results_by_node():  add use_labels option

* -

* -

* -

* • composition.py
  - get_results_by_nodes: allow specification of individual nodes

* • composition.py
  - get_results_by_nodes: allow specification of individual nodes

* • composition.py
  - get_results_by_nodes: allow specification of individual nodes

* -

* -

* • mechanism.py:
  add input_labels and output_labels as args to constructor

* -

* -

* • project:  remove scale from figures

* -

* -

* -

* • README.rst and composition.py:  add links to CGO paper

* • README.rst, index.rst and composition.py:
  - updates to contribtors
  - add links to CGO paper

Co-authored-by: Katherine Mantel <[email protected]>
Co-authored-by: jdcpni <pniintel55>
@jdcpni jdcpni temporarily deployed to github-pages December 23, 2021 03:41 Inactive
@github-actions
Copy link

This PR causes the following changes to the html docs (ubuntu-latest-3.7-x64):

diff -r docs-base/.buildinfo docs-head/.buildinfo
3c3
< config: e4eaff8bd460a1755b5775922fbff125
---
> config: 93a36d7daeeffc980fdbe13b5661e43b
diff -r docs-base/AGTControlMechanism.html docs-head/AGTControlMechanism.html
232c232
< <p>An AGTControlMechanism is a <a class="reference internal" href="ControlMechanism.html"><span class="doc">ControlMechanism</span></a> that uses an ObjectiveMechanism with a <code class="xref any docutils literal notranslate"><span class="pre">DualAdaptiveIntegrator</span></code>
---
> <p>An AGTControlMechanism is a <a class="reference internal" href="ControlMechanism.html"><span class="doc">ControlMechanism</span></a> that uses an ObjectiveMechanism with a <a class="reference internal" href="IntegratorFunctions.html#psyneulink.core.components.functions.stateful.integratorfunctions.DualAdaptiveIntegrator" title="psyneulink.core.components.functions.stateful.integratorfunctions.DualAdaptiveIntegrator"><code class="xref any py py-class docutils literal notranslate"><span class="pre">DualAdaptiveIntegrator</span></code></a>
234c234
< to regulate the <code class="xref any docutils literal notranslate"><span class="pre">mode</span></code> parameter of its <code class="xref any docutils literal notranslate"><span class="pre">FitzHughNagumoIntegrator</span></code> Function, it implements a form of the
---
> to regulate the <a class="reference internal" href="IntegratorFunctions.html#psyneulink.core.components.functions.stateful.integratorfunctions.FitzHughNagumoIntegrator.mode" title="psyneulink.core.components.functions.stateful.integratorfunctions.FitzHughNagumoIntegrator.mode"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">mode</span></code></a> parameter of its <a class="reference internal" href="IntegratorFunctions.html#psyneulink.core.components.functions.stateful.integratorfunctions.FitzHughNagumoIntegrator" title="psyneulink.core.components.functions.stateful.integratorfunctions.FitzHughNagumoIntegrator"><code class="xref any py py-class docutils literal notranslate"><span class="pre">FitzHughNagumoIntegrator</span></code></a> Function, it implements a form of the
244c244
< <code class="xref any docutils literal notranslate"><span class="pre">DualAdaptiveIntegrator</span></code> Function as its <a class="reference internal" href="ObjectiveMechanism.html#psyneulink.core.components.mechanisms.processing.objectivemechanism.ObjectiveMechanism.function" title="psyneulink.core.components.mechanisms.processing.objectivemechanism.ObjectiveMechanism.function"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">function</span></code></a>.</p>
---
> <a class="reference internal" href="IntegratorFunctions.html#psyneulink.core.components.functions.stateful.integratorfunctions.DualAdaptiveIntegrator" title="psyneulink.core.components.functions.stateful.integratorfunctions.DualAdaptiveIntegrator"><code class="xref any py py-class docutils literal notranslate"><span class="pre">DualAdaptiveIntegrator</span></code></a> Function as its <a class="reference internal" href="ObjectiveMechanism.html#psyneulink.core.components.mechanisms.processing.objectivemechanism.ObjectiveMechanism.function" title="psyneulink.core.components.mechanisms.processing.objectivemechanism.ObjectiveMechanism.function"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">function</span></code></a>.</p>
259c259
< ObjectiveMechanism is created automatically when the AGTControlMechanism is created, using a <code class="xref any docutils literal notranslate"><span class="pre">DualAdaptiveIntegrator</span></code>
---
> ObjectiveMechanism is created automatically when the AGTControlMechanism is created, using a <a class="reference internal" href="IntegratorFunctions.html#psyneulink.core.components.functions.stateful.integratorfunctions.DualAdaptiveIntegrator" title="psyneulink.core.components.functions.stateful.integratorfunctions.DualAdaptiveIntegrator"><code class="xref any py py-class docutils literal notranslate"><span class="pre">DualAdaptiveIntegrator</span></code></a>
326c326
< <code class="xref any docutils literal notranslate"><span class="pre">DualAdaptiveIntegrator</span></code> as is <a class="reference internal" href="ObjectiveMechanism.html#psyneulink.core.components.mechanisms.processing.objectivemechanism.ObjectiveMechanism.function" title="psyneulink.core.components.mechanisms.processing.objectivemechanism.ObjectiveMechanism.function"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">function</span></code></a>.</p>
---
> <a class="reference internal" href="IntegratorFunctions.html#psyneulink.core.components.functions.stateful.integratorfunctions.DualAdaptiveIntegrator" title="psyneulink.core.components.functions.stateful.integratorfunctions.DualAdaptiveIntegrator"><code class="xref any py py-class docutils literal notranslate"><span class="pre">DualAdaptiveIntegrator</span></code></a> as is <a class="reference internal" href="ObjectiveMechanism.html#psyneulink.core.components.mechanisms.processing.objectivemechanism.ObjectiveMechanism.function" title="psyneulink.core.components.mechanisms.processing.objectivemechanism.ObjectiveMechanism.function"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">function</span></code></a>.</p>
diff -r docs-base/AutoAssociativeLearningMechanism.html docs-head/AutoAssociativeLearningMechanism.html
228c228
< <p>An AutoAssociativeLearningMechanism is a subclass of <a class="reference internal" href="LearningMechanism.html"><span class="doc">Learning Mechanism</span></a>, modified for use with a
---
> <p>An AutoAssociativeLearningMechanism is a subclass of <a class="reference internal" href="LearningMechanism.html"><span class="doc">LearningMechanism</span></a>, modified for use with a
239c239
< <p>An AutoAssociativeLearningMechanism is identical to a <a class="reference internal" href="LearningMechanism.html"><span class="doc">Learning Mechanism</span></a> in all respects except the following:</p>
---
> <p>An AutoAssociativeLearningMechanism is identical to a <a class="reference internal" href="LearningMechanism.html"><span class="doc">LearningMechanism</span></a> in all respects except the following:</p>
257c257
< to the weight change matrix;  as with a standard <a class="reference internal" href="LearningMechanism.html"><span class="doc">Learning Mechanism</span></a>, a scalar can also be specified to scale
---
> to the weight change matrix;  as with a standard <a class="reference internal" href="LearningMechanism.html"><span class="doc">LearningMechanism</span></a>, a scalar can also be specified to scale
265c265
< <p>An AutoAssociativeLearningMechanism executes in the same manner as standard <a class="reference internal" href="LearningMechanism.html"><span class="doc">Learning Mechanism</span></a>, with two exceptions:
---
> <p>An AutoAssociativeLearningMechanism executes in the same manner as standard <a class="reference internal" href="LearningMechanism.html"><span class="doc">LearningMechanism</span></a>, with two exceptions:
282c282
< <dd><p>Implements a <a class="reference internal" href="LearningMechanism.html"><span class="doc">Learning Mechanism</span></a> that modifies the <a class="reference internal" href="MappingProjection.html#psyneulink.core.components.projections.pathway.mappingprojection.MappingProjection.matrix" title="psyneulink.core.components.projections.pathway.mappingprojection.MappingProjection.matrix"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">matrix</span></code></a> parameter of an
---
> <dd><p>Implements a <a class="reference internal" href="LearningMechanism.html"><span class="doc">LearningMechanism</span></a> that modifies the <a class="reference internal" href="MappingProjection.html#psyneulink.core.components.projections.pathway.mappingprojection.MappingProjection.matrix" title="psyneulink.core.components.projections.pathway.mappingprojection.MappingProjection.matrix"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">matrix</span></code></a> parameter of an
418c418
< <a class="reference internal" href="LearningMechanism.html"><span class="doc">Learning Mechanism</span></a>, it can be assigned additional LearningSignals and/or LearningProjections to train
---
> <a class="reference internal" href="LearningMechanism.html"><span class="doc">LearningMechanism</span></a>, it can be assigned additional LearningSignals and/or LearningProjections to train
diff -r docs-base/AutodiffComposition.html docs-head/AutodiffComposition.html
389,391c389,392
< <li><p><strong>num_trials</strong> (<em>int</em><em> (</em><em>default=None</em><em>)</em>) – typically, the composition will infer the number of trials from the length of its input specification.
< To reuse the same inputs across many trials, you may specify an input dictionary with lists of length 1,
< or use default inputs, and select a number of trials with num_trials.</p></li>
---
> <li><p><strong>num_trials</strong> (<em>int</em><em> (</em><em>default=None</em><em>)</em>) – typically, the Composition infers the number of trials to execute from the length of its input
> specification.  However, <strong>num_trials</strong> can be used to enforce an exact number of trials to execute;
> if it is greater than there are inputs then inputs will be repeated (see <a class="reference internal" href="Composition.html#composition-execution-inputs"><span class="std std-ref">Composition Inputs</span></a>
> for additional information).</p></li>
471,474c472,477
< <dd class="field-even"><p><strong>output value of the final Mechanism executed in the Composition</strong></p>
< </dd>
< <dt class="field-odd">Return type</dt>
< <dd class="field-odd"><p>various</p>
---
> <dd class="field-even"><p><ul class="simple">
> <li><p><strong>output_values</strong> (<em>List</em>)</p></li>
> <li><p><em>These are the values of the Composition’s output_CIM.output_ports, excluding those the source of which</em></p></li>
> <li><p><em>are from a (potentially nested) Node with NodeRole.PROBE in its enclosing Composition.</em></p></li>
> </ul>
> </p>
diff -r docs-base/BasicsAndPrimer.html docs-head/BasicsAndPrimer.html
443c443
< assigning <code class="xref any docutils literal notranslate"><span class="pre">DriftDiffusionIntegrator</span></code> as the Mechanism’s <a class="reference internal" href="DDM.html#psyneulink.library.components.mechanisms.processing.integrator.ddm.DDM.function" title="psyneulink.library.components.mechanisms.processing.integrator.ddm.DDM.function"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">function</span></code></a> and, in the call to the Composition’s
---
> assigning <a class="reference internal" href="IntegratorFunctions.html#psyneulink.core.components.functions.stateful.integratorfunctions.DriftDiffusionIntegrator" title="psyneulink.core.components.functions.stateful.integratorfunctions.DriftDiffusionIntegrator"><code class="xref any py py-class docutils literal notranslate"><span class="pre">DriftDiffusionIntegrator</span></code></a> as the Mechanism’s <a class="reference internal" href="DDM.html#psyneulink.library.components.mechanisms.processing.integrator.ddm.DDM.function" title="psyneulink.library.components.mechanisms.processing.integrator.ddm.DDM.function"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">function</span></code></a> and, in the call to the Composition’s
459c459
< <p>The output is now the result of the <code class="xref any docutils literal notranslate"><span class="pre">DriftDiffusionIntegrator</span></code>, which is the value of the decision variable when it
---
> <p>The output is now the result of the <a class="reference internal" href="IntegratorFunctions.html#psyneulink.core.components.functions.stateful.integratorfunctions.DriftDiffusionIntegrator" title="psyneulink.core.components.functions.stateful.integratorfunctions.DriftDiffusionIntegrator"><code class="xref any py py-class docutils literal notranslate"><span class="pre">DriftDiffusionIntegrator</span></code></a>, which is the value of the decision variable when it
858c858
< of a <a class="reference internal" href="Mechanism.html"><span class="doc">Mechanism</span></a> or a <a class="reference internal" href="Projection.html"><span class="doc">Projection</span></a> is modulable, it is assigned a <a class="reference internal" href="ParameterPort.html"><span class="doc">ParameterPort</span></a> – this is a
---
> of a <a class="reference internal" href="Mechanism.html"><span class="doc">Mechanism</span></a> or a <a class="reference internal" href="Projection.html"><span class="doc">Projection</span></a> is modulable, it may be assigned a <a class="reference internal" href="ParameterPort.html"><span class="doc">ParameterPort</span></a> – this is a
893a894,902
> <p>Some Parameters may be modulable, but not <em>modulated</em> by a
> ParameterPort, because ParameterPorts are only created for Parameters
> whose values are numeric at the time of Component construction. For
> example, <a class="reference internal" href="TransferMechanism.html#psyneulink.core.components.mechanisms.processing.transfermechanism.TransferMechanism.termination_threshold" title="psyneulink.core.components.mechanisms.processing.transfermechanism.TransferMechanism.termination_threshold"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">TransferMechanism.termination_threshold</span></code></a> has a default value
> of None and will not have a ParameterPort by default. Similarly, when
> <a class="reference internal" href="TransferMechanism.html#psyneulink.core.components.mechanisms.processing.transfermechanism.TransferMechanism.noise" title="psyneulink.core.components.mechanisms.processing.transfermechanism.TransferMechanism.noise"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">noise</span></code></a> is set to a function or value
> containing a function, it will not have an associated ParameterPort.</p>
> <p>In this case, dot notation for these modulable Parameters will behave
> the same as for non-modulable Parameters.</p>
971c980
< <p>PsyNeuLink has a native class – <a class="reference internal" href="LearningMechanism.html"><span class="doc">Learning Mechanism</span></a> – that can be used to implement various forms of learning,
---
> <p>PsyNeuLink has a native class – <a class="reference internal" href="LearningMechanism.html"><span class="doc">LearningMechanism</span></a> – that can be used to implement various forms of learning,
1119c1128
< <a class="reference internal" href="index.html#tutorial"><span class="std std-ref">Tutorial</span></a> provides a more thorough, interactive introduction to its use, and the <a class="reference internal" href="UserGuide.html"><span class="doc">User's Guide</span></a> provides
---
> <a class="reference internal" href="index_logo_with_text.html#tutorial"><span class="std std-ref">Tutorial</span></a> provides a more thorough, interactive introduction to its use, and the <a class="reference internal" href="UserGuide.html"><span class="doc">User's Guide</span></a> provides
diff -r docs-base/CombinationFunctions.html docs-head/CombinationFunctions.html
223c223
< <dd><p id="concatenate">Concatenates items in outer dimension (axis 0) of of <code class="xref any docutils literal notranslate"><span class="pre">variable</span></code> into a single array,
---
> <dd><p id="concatenate">Concatenates items in outer dimension (axis 0) of <code class="xref any docutils literal notranslate"><span class="pre">variable</span></code> into a single array,
225c225
< <p><code class="xref any docutils literal notranslate"><span class="pre">function</span></code> returns a 1d array with lenght equal to the sum of the lengths of the items
---
> <p><code class="xref any docutils literal notranslate"><span class="pre">function</span></code> returns a 1d array with length equal to the sum of the lengths of the items
diff -r docs-base/Compilation.html docs-head/Compilation.html
204c204,208
< The performance improvements varies, but it has been observed to be between one and three orders of magnitude depending on the model.</p>
---
> The perfo
...

See CI logs for the full diff.

@lgtm-com
Copy link
Contributor

lgtm-com bot commented Dec 23, 2021

This pull request introduces 14 alerts and fixes 48 when merging 9979c07 into 912f691 - view on LGTM.com

new alerts:

  • 4 for Except block handles 'BaseException'
  • 3 for Unused local variable
  • 2 for Modification of dictionary returned by locals()
  • 1 for Wrong name for an argument in a call
  • 1 for Comparison using is when operands support `__eq__`
  • 1 for Unreachable code
  • 1 for Module is imported with 'import' and 'import from'
  • 1 for `__init__` method calls overridden method

fixed alerts:

  • 33 for Unused import
  • 12 for Comparison using is when operands support `__eq__`
  • 1 for Wrong name for an argument in a call
  • 1 for Except block handles 'BaseException'
  • 1 for `__init__` method calls overridden method

@jdcpni jdcpni merged commit 5efe4d9 into master Dec 23, 2021
jvesely added a commit that referenced this pull request Jan 2, 2022
A follow up merge to preserve history
jvesely added a commit to jvesely/PsyNeuLink that referenced this pull request Jan 3, 2022
kmantel added a commit that referenced this pull request Jan 4, 2022
kmantel added a commit that referenced this pull request Jan 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants